/* YouppyGif, correzioni del 02.11.2026: barra in basso, reel, pacchetti, box di partenza, editor, proposta IA, file e dispositivi.
   Usa i colori di app.css (--fondo, --pannello, --linea, --testo, --tenue, --rosso). */
.icona { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nascosto { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; opacity: 0 !important; pointer-events: none !important; }
.tenue { color: var(--tenue); }
body { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); }

/* ---- barre di scorrimento: solo il corpo, nel colore del tema, senza frecce (#3) ---- */
/* niente scrollbar-width qui: in Chrome/Edge rimetterebbe le barre di sistema con le frecce */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d52b1e99; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--rosso); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- barra in basso (#1, #10): icone monocromatiche, nome sotto, «Crea» al centro con il fondo del tema ---- */
.barra { position: fixed; inset: auto 0 0; z-index: 6; display: flex; justify-content: center; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--pannello) 96%, transparent); border-top: 1px solid var(--linea); backdrop-filter: blur(10px); }
.barra button { flex: 1; max-width: 120px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 6px 0 3px;
  border: 0; border-radius: 14px; background: none; color: var(--tenue); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.barra button .icona { width: 24px; height: 24px; }
.barra button:hover { color: var(--testo); }
.barra button[aria-selected="true"] { color: #fff; }
.barra button[aria-selected="true"] .icona { stroke-width: 2.2; }
.barra .centrale b { display: grid; place-items: center; width: 46px; height: 32px; border-radius: 12px; background: var(--rosso); color: #fff; }
.barra .centrale b .icona { width: 22px; height: 22px; stroke-width: 2.4; }
.barra .centrale[aria-selected="true"] b { box-shadow: 0 0 0 2px #fff3; }
.avviso { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }

/* ---- segmenti e chip ---- */
.seg { display: flex; gap: 4px; margin: .6rem 0 .2rem; padding: 3px; border: 1px solid var(--linea); border-radius: 999px; background: var(--pannello); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > button, .seg > label { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 34px; padding: 0 .9rem; border: 0; border-radius: 999px;
  background: none; color: #c9ced4; font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.seg > button[aria-pressed="true"], .seg > label.on { background: #d52b1e2e; color: #fff; box-shadow: inset 0 0 0 1px var(--rosso); }
.seg.grande > button { min-height: 44px; font-weight: 600; font-size: .95rem; }
.seg.piccolo { display: inline-flex; margin: 0; }
.seg.piccolo label { flex-direction: row !important; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.chip-fila.a-capo { flex-wrap: wrap; overflow: visible; }
.chip-fila button[aria-pressed="true"] { border-color: var(--rosso); background: #d52b1e2e; color: #fff; }
.info { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--tenue); cursor: pointer; vertical-align: middle; }
.info .icona { width: 18px; height: 18px; }
.info[aria-expanded="true"] { color: var(--rosso-chiaro); }
.info-testo { flex-basis: 100%; margin: .3rem 0 .4rem; padding: .6rem .8rem; border-radius: 12px; background: #24282f; color: #c9ced4; font-size: .86rem; }
.info-testo[hidden] { display: none; }
.tondo { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #ffffff10; color: var(--testo); cursor: pointer; flex: none; }
.tondo .icona { width: 18px; height: 18px; }
.pulsante .icona { width: 19px; height: 19px; }
.pulsante.piccolo { min-height: 34px; padding: 0 .8rem; font-size: .85rem; }
.pulsante.largo { width: 100%; }
.riga-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.riga-azioni[hidden] { display: none; }
.riga-azioni .pulsante.secondario { display: inline-flex; margin: 0; }
.riga-azioni select { width: auto; flex: 1 1 10rem; }
.cella.sticker > button { background: repeating-conic-gradient(#2a2e35 0 25%, #22252b 0 50%) 0 0 / 16px 16px !important; }

/* ---- pacchetti (#8, #9) ---- */
.pacchetti-testa { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .8rem 0 .2rem; }
.pacchetti-testa h2 { margin: 0; }
.gruppo-pacchetti h3 { margin: 1rem 0 .4rem; font-size: .95rem; color: #c9ced4; }
.fila-pacchetti { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: .5rem; }
.pacchetto { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: .5rem; border: 1px solid var(--linea); border-radius: 14px; background: var(--pannello); color: var(--testo); font: inherit; text-align: left; cursor: pointer; }
.pacchetto:hover { border-color: var(--c); }
.pacchetto .copertina { display: grid; place-items: center; width: 100%; aspect-ratio: 1.4; margin-bottom: .3rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 70%, #000); overflow: hidden; }
.pacchetto .copertina img { width: 100%; height: 100%; object-fit: cover; }
.pacchetto .emoji { font-size: 2rem; }
.pacchetto b { font-size: .88rem; line-height: 1.2; }
.pacchetto small { color: var(--tenue); font-size: .75rem; }
.pacchetto-testa { display: flex; align-items: center; gap: .6rem; margin: .8rem 0 .3rem; padding: .6rem; border-radius: 16px; background: color-mix(in srgb, var(--c) 35%, var(--pannello)); }
.pacchetto-testa h2 { margin: 0; }
.pacchetto-testa .emoji { font-size: 1.8rem; }

/* ---- reel (#10): una GIF per schermata, scorre in verticale ---- */
#v-reel .seg { margin-top: .2rem; }
.reel { height: calc(100dvh - 13.2rem - env(safe-area-inset-bottom)); min-height: 20rem; margin-top: .5rem; overflow-y: auto; scroll-snap-type: y mandatory; border-radius: 18px; scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.carta-reel { position: relative; display: grid; place-items: center; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c, #333) 55%, #000), #0b0c0f 75%); margin-bottom: .5rem; }
.carta-reel.sticker { background: radial-gradient(circle at 50% 40%, #2a2e35, #0b0c0f 75%); }
.carta-reel > img { max-width: 88%; max-height: 72%; border-radius: 14px; object-fit: contain; cursor: zoom-in; }
.carta-reel.sticker > img { border-radius: 0; filter: drop-shadow(0 8px 18px #0008); }
.carta-reel.vuota p { max-width: 18rem; color: var(--tenue); text-align: center; }
.reel-info { position: absolute; inset: auto 4.4rem 1rem 1rem; display: flex; flex-direction: column; text-shadow: 0 1px 4px #000; }
.reel-info b { font-size: 1.05rem; }
.reel-info small { color: #d6dadf; }
.reel-azioni { position: absolute; inset: auto .6rem 1rem auto; display: flex; flex-direction: column; gap: .7rem; }
.azione-reel { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 3.2rem; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: .7rem; text-decoration: none; cursor: pointer; text-shadow: 0 1px 3px #000; }
.azione-reel .icona { width: 28px; height: 28px; padding: 6px; box-sizing: content-box; border-radius: 50%; background: #0007; }
.azione-reel[aria-pressed="true"] .icona { fill: #ffd34a; stroke: #ffd34a; }
.reel-fondo { height: 1px; }

/* ---- crea: tipo, box di partenza (#4), proposta IA (#6), passi ---- */
.scelta-sorgente { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: .45rem !important; }
.box-sorgente { position: relative; display: flex !important; flex-direction: column !important; align-items: center; justify-content: center; gap: .45rem !important; min-height: 92px; padding: .7rem .3rem;
  border: 1px solid var(--linea); border-radius: 16px; background: var(--pannello); color: var(--testo); font: inherit; text-align: center; cursor: pointer; }
.box-sorgente .icona { width: 30px; height: 30px; stroke-width: 1.6; }
.box-sorgente span { font-size: .78rem !important; color: #c9ced4; line-height: 1.2; }
.box-sorgente:hover { border-color: #3a404a; }
.box-sorgente:has(input:checked) { border-color: var(--rosso); background: #d52b1e1f; }
.box-sorgente[data-box="file"] .icona, .box-sorgente[data-box="camera"] .icona { color: var(--testo); }
@media (max-width: 560px) {
  .scelta-sorgente { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .box-sorgente[data-box="camera"] { grid-column: span 1; }
}
.crea-vista { min-height: 8rem; }
h3.passo { display: flex; align-items: center; gap: .45rem; margin: .6rem 0 -.2rem; font-size: .98rem; }
h3.passo small { color: var(--tenue); font-weight: 400; }
h3.passo .icona { width: 19px; height: 19px; color: var(--rosso-chiaro); }
.box-ia { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; border: 1px solid #d52b1e55; border-radius: 18px; background: linear-gradient(160deg, #d52b1e1c, var(--pannello) 55%); }
.ia-testa { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.ia-testa b { font-size: 1.02rem; }
.ia-stella { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #d52b1e33; }
.ia-gruppo h4 { margin: .2rem 0 .3rem; font-size: .84rem; font-weight: 600; color: var(--tenue); }
.ia-gruppo .chip-fila { margin: 0; }
.ia-scrivi input { border-radius: 14px; }
.ia-vai { margin-top: .2rem; }
.ia-esito { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: .6rem .8rem; border-radius: 12px; background: #24282f; font-size: .88rem; }
.ia-esito[hidden] { display: none; }

/* ---- finestre ---- */
dialog.finestra { width: min(36rem, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem); padding: 0; border: 1px solid var(--linea); border-radius: 18px; background: var(--fondo); color: var(--testo); }
dialog.finestra::backdrop { background: #000c; }
.finestra-testa { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem .5rem 1rem; background: var(--fondo); }
.finestra-testa b { font-size: 1.05rem; }
.finestra-corpo { display: flex; flex-direction: column; gap: .6rem; padding: 0 1rem 1rem; }
.finestra-corpo p { margin: 0; }
.spunta { display: flex; align-items: center; gap: .5rem; color: #c9ced4; font-size: .92rem; }
.spunta input { width: 20px; height: 20px; accent-color: var(--rosso); }
/* fotocamera */
.cam-video { width: 100%; max-height: 52vh; border-radius: 14px; background: #000; object-fit: cover; }
.cam-scatti { display: flex; gap: .3rem; overflow-x: auto; }
.cam-scatti img { height: 3.4rem; border-radius: 8px; }
.cam-tasti { display: flex; align-items: center; justify-content: center; gap: 1.4rem; }
.cam-tasto { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--linea); border-radius: 50%; background: var(--pannello); color: #fff; cursor: pointer; }
.cam-tasto.grande { width: 66px; height: 66px; }
.cam-tasto.grande .icona { width: 40px; height: 40px; }
.cam-tasto.registra { color: var(--rosso); }
.cam-tasto.registra.on { animation: pulsa 1s infinite; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 6px #d52b1e55; } }

/* ---- editor (#5), stile YouppyVideo: anteprima, trasporto, strumenti, timeline ---- */
dialog.editor { width: min(46rem, calc(100vw - 1rem)); }
.ed-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; font-size: .85rem; }
.ed-palco { display: grid; place-items: center; min-height: 12rem; padding: .6rem; border-radius: 14px; background: #08090b; }
.ed-cornice { position: relative; max-width: 100%; overflow: hidden; border-radius: 6px; }
.ed-cornice > video, .ed-cornice > img { display: block; max-width: 100%; max-height: 44vh; object-fit: cover; }
.ed-cornice[data-formato="quadrato"] > video, .ed-cornice[data-formato="quadrato"] > img { aspect-ratio: 1; width: min(44vh, 100%); }
.ed-cornice[data-formato="verticale"] > video, .ed-cornice[data-formato="verticale"] > img { aspect-ratio: 9 / 16; height: 44vh; width: auto; }
.ed-cornice[data-formato="orizzontale"] > video, .ed-cornice[data-formato="orizzontale"] > img { aspect-ratio: 16 / 9; width: 100%; }
.ed-cornice[data-formato="sticker"] { padding: 7px; border-radius: 24px; background: #fff; }
.ed-cornice[data-formato="sticker"] > video, .ed-cornice[data-formato="sticker"] > img { border-radius: 18px; }
.ed-trasporto { display: flex; align-items: center; justify-content: center; gap: .8rem; }
.ed-play { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--rosso); color: #fff; cursor: pointer; }
.ed-tempo { min-width: 9rem; font-variant-numeric: tabular-nums; color: #c9ced4; font-size: .9rem; }
.ed-strumenti { display: flex; gap: .3rem; padding: .3rem; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); overflow-x: auto; }
.ed-strumenti button { flex: 1 0 4.2rem; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem .2rem; border: 0; border-radius: 10px; background: none; color: var(--tenue); font: inherit; font-size: .75rem; cursor: pointer; }
.ed-strumenti button[aria-pressed="true"] { color: #fff; background: #ffffff10; }
.ed-pannello { display: flex; flex-direction: column; gap: .5rem; min-height: 5.5rem; }
.ed-timeline { display: flex; flex-direction: column; gap: 2px; }
.ed-righello { display: flex; justify-content: space-between; color: var(--tenue); font-size: .7rem; padding: 0 2px; }
.ed-pista { position: relative; height: 58px; border-radius: 8px; background: #0b0c0f; overflow: hidden; touch-action: none; cursor: pointer; }
.ed-striscia { display: flex; height: 100%; opacity: .55; pointer-events: none; }
.ed-striscia canvas { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.ed-sel { position: absolute; top: 0; bottom: 0; border: 3px solid var(--rosso); border-radius: 8px; background: #d52b1e22; box-shadow: 0 0 0 999px #0007; cursor: grab; }
.maniglia { position: absolute; top: 50%; width: 14px; height: 34px; margin-top: -17px; border-radius: 5px; background: var(--rosso); cursor: ew-resize; }
.maniglia::after { content: ""; position: absolute; inset: 9px 5px; border-inline: 2px solid #fff9; }
.maniglia.sx { left: -9px; } .maniglia.dx { right: -9px; }
.ed-testina { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.ed-scritte { color: #c9ced4; font-size: .85rem; }
.ed-foto { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; }
.ed-foto-una { flex: none; display: flex; flex-direction: column; gap: 2px; }
.ed-foto-una img { width: 5.4rem; height: 5.4rem; object-fit: cover; border-radius: 8px; }
.ed-foto-una div { display: flex; justify-content: space-between; }
.ed-foto-una button { padding: 2px; border: 0; background: none; color: var(--tenue); cursor: pointer; }
.ed-foto-una button:disabled { opacity: .3; }
.ed-foto-una .icona { width: 17px; height: 17px; }
.ed-pannello input[type=text] { width: 100%; }

/* ---- mie: profilo, file e dispositivi (#2) ---- */
.profilo-testa { display: flex; align-items: center; gap: .7rem; margin: .6rem 0 .2rem; }
.profilo-testa .avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--rosso); color: #fff; font-weight: 800; font-size: 1.2rem; }
.profilo-testa div { display: flex; flex-direction: column; }
.parte[hidden] { display: none; }
.riquadro-file { display: flex; flex-direction: column; gap: .4rem; margin-top: .8rem; padding: .9rem; border: 1px solid var(--linea); border-radius: 16px; background: var(--pannello); }
.file-testa { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.file-testa h3 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: 1rem; }
.file-testa h3 .icona { width: 18px; height: 18px; color: var(--rosso-chiaro); }
.dispositivi, .bozze { display: flex; flex-direction: column; gap: .4rem; }
.dispositivo, .bozza { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--linea); }
.dispositivo:first-child, .bozza:first-child { border-top: 0; }
.dispositivo > div, .bozza > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dispositivo b, .bozza b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.disp-icona { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #ffffff0d; flex: none; }
.disp-icona.grande { width: 46px; height: 46px; }
.disp-icona .punto { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid var(--pannello); border-radius: 50%; background: #22c55e; }
.link-file { flex-direction: row; align-items: center; gap: .7rem; color: var(--testo); text-decoration: none; }
.link-file > div { flex: 1; display: flex; flex-direction: column; }
.link-file:hover { border-color: #3a404a; }

@media (min-width: 900px) {
  .barra { padding-inline: calc(50vw - 24rem); }
  .reel { height: calc(100dvh - 12.6rem); max-width: 30rem; margin-inline: auto; }
  #reel-filtri { max-width: 30rem; margin-inline: auto; }
}
