:root { --fondo: #14161a; --pannello: #1a1d23; --linea: #2a2f37; --testo: #e8eaed; --tenue: #98a1ab; --rosso: #d52b1e; --rosso-chiaro: #ff8a7d; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--testo); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 3px; background: var(--rosso); z-index: 5; }
.testa { display: flex; align-items: center; gap: .6rem; max-width: 60rem; margin: 0 auto; padding: 1rem 1rem .4rem; }
.testa img { border-radius: 10px; }
.testa b { font-size: 1.3rem; letter-spacing: .2px; }
/* bandiera svizzera disegnata (le emoji delle bandiere su Windows diventano "CH") */
.svizzera { position: relative; width: 22px; height: 22px; margin-inline-start: auto; border-radius: 4px; background: var(--rosso); flex: none; }
.svizzera::before, .svizzera::after { content: ""; position: absolute; inset: 0; margin: auto; background: #fff; }
.svizzera::before { width: 12px; height: 4px; } .svizzera::after { width: 4px; height: 12px; }
.schede { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; max-width: 60rem; margin: 0 auto; padding: .5rem 1rem; background: color-mix(in srgb, var(--fondo) 92%, transparent); backdrop-filter: blur(8px); }
.schede button { min-width: 0; min-height: 40px; padding: 0 .3rem; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--linea); border-radius: 999px; background: var(--pannello); color: #c9ced4; font: inherit; font-size: .86rem; cursor: pointer; white-space: nowrap; }
.schede button[aria-selected="true"] { border-color: var(--rosso); background: #d52b1e2e; color: #fff; }
main { max-width: 60rem; margin: 0 auto; padding: .4rem 1rem 1rem; }
.vista[hidden] { display: none; }
input[type=search], input[type=text], select { width: 100%; padding: .7rem 1rem; border: 1px solid var(--linea); border-radius: 12px; background: var(--pannello); color: var(--testo); font: inherit; outline: none; }
input[type=search] { border-radius: 999px; }
input:focus, select:focus { border-color: var(--rosso); }
.chip-fila { display: flex; gap: .35rem; margin: .6rem 0; overflow-x: auto; scrollbar-width: none; }
.chip-fila::-webkit-scrollbar { display: none; }
.chip-fila button { flex: none; padding: .35rem .8rem; border: 1px solid var(--linea); border-radius: 999px; background: var(--pannello); color: #c9ced4; font: inherit; font-size: .88rem; cursor: pointer; }
.chip-fila button[aria-pressed="true"] { border-color: var(--rosso); background: #d52b1e2e; color: #fff; }
.griglia { columns: 2 10rem; column-gap: .5rem; margin-top: .4rem; }
.cella { position: relative; break-inside: avoid; margin-bottom: .5rem; }
.cella > button { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #24282f; }
.cella img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cella > button:focus-visible { outline: 3px solid var(--rosso); outline-offset: 2px; }
.etichetta { position: absolute; inset: auto .35rem .35rem auto; padding: .1rem .45rem; border-radius: 999px; background: #000b; color: #fff; font-size: .72rem; pointer-events: none; }
.etichetta.nascosta { inset: .35rem auto auto .35rem; background: var(--rosso); }
.vuoto { margin: 2rem 1rem; text-align: center; color: var(--tenue); }
.vuoto[hidden] { display: none; }
.fondo { height: 1px; }
.spiega { margin: .3rem 0 .7rem; color: var(--tenue); font-size: .9rem; }
h2 { margin: 1.4rem 0 .3rem; font-size: 1.05rem; }
.riquadro { margin-top: 1rem; padding: 1.2rem; border: 1px solid var(--linea); border-radius: 16px; background: var(--pannello); text-align: center; }
.riquadro[hidden] { display: none; }
.pulsante { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: 0 1.3rem; border: 0; border-radius: 999px; background: var(--rosso); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.pulsante:hover { background: #e63a2c; }
.pulsante:disabled { opacity: .6; cursor: progress; }
.pulsante.secondario { display: flex; margin: 1rem auto; background: var(--pannello); border: 1px solid var(--linea); font-weight: 600; }
.pulsante[hidden] { display: none; }
.modulo { display: flex; flex-direction: column; gap: .8rem; margin-top: .6rem; }
.modulo[hidden] { display: none; }
.modulo label { display: flex; flex-direction: column; gap: .3rem; color: #c9ced4; font-size: .92rem; }
.scelta-sorgente { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.sorgente { flex-direction: column !important; align-items: center; justify-content: center; min-height: 72px; padding: .5rem; border: 1px solid var(--linea); border-radius: 14px; background: var(--pannello); text-align: center; font-size: 1.3rem !important; cursor: pointer; }
.sorgente span { font-size: .8rem; color: #c9ced4; }
.sorgente input { position: absolute; opacity: 0; pointer-events: none; }
.sorgente:has(input:checked) { border-color: var(--rosso); background: #d52b1e26; }
input[type=file] { color: var(--tenue); font-size: .9rem; }
input[type=file]::file-selector-button { margin-inline-end: .7rem; padding: .55rem 1rem; border: 0; border-radius: 999px; background: #2a2f37; color: #fff; font: inherit; cursor: pointer; }
.crea-vista { position: relative; display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--linea); border-radius: 14px; overflow: hidden; color: var(--tenue); font-size: .9rem; text-align: center; background: #0f1114; }
.crea-vista video, .crea-vista img { display: block; max-width: 100%; max-height: 18rem; }
.crea-vista .striscia { display: flex; gap: .3rem; padding: .5rem; overflow-x: auto; }
.crea-vista .striscia img { height: 6rem; border-radius: 8px; }
.anteprima-testo { position: absolute; inset-inline: .5rem; margin: 0; color: #fff; font-weight: 800; font-size: clamp(1rem, 5vw, 1.6rem); line-height: 1.1; text-align: center; -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; pointer-events: none; }
.anteprima-testo.sopra { top: 4%; } .anteprima-testo.sotto { bottom: 5%; }
.anteprima-testo[hidden] { display: none; }
.opzioni { display: flex; flex-direction: column; gap: .7rem; margin: 0; padding: .8rem; border: 1px solid var(--linea); border-radius: 14px; }
.opzioni[hidden] { display: none; }
.opzioni output { float: right; color: var(--rosso-chiaro); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--rosso); }
.posizione { display: flex; gap: 1rem; color: #c9ced4; font-size: .92rem; }
.posizione label { flex-direction: row !important; align-items: center; gap: .35rem !important; }
.nota { color: var(--tenue); }
dialog.scheda { width: min(32rem, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem); padding: 1rem; border: 1px solid var(--linea); border-radius: 18px; background: var(--fondo); color: var(--testo); }
dialog.scheda::backdrop { background: #000c; }
.scheda img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: #0f1114; }
.scheda h3 { margin: .8rem 0 .2rem; font-size: 1.1rem; }
.credito { margin: 0 0 .6rem; color: var(--tenue); font-size: .85rem; }
.credito a { color: var(--rosso-chiaro); }
.chiudi { position: absolute; top: .4rem; inset-inline-end: .4rem; z-index: 1; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #000a; color: #fff; font-size: 1.4rem; cursor: pointer; }
.azioni { display: flex; flex-wrap: wrap; gap: .4rem; }
.azioni button, .azioni a { flex: 1 1 auto; min-height: 42px; padding: 0 .9rem; border: 1px solid var(--linea); border-radius: 999px; background: var(--pannello); color: var(--testo); font: inherit; font-size: .92rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.azioni .principale { border-color: var(--rosso); background: var(--rosso); color: #fff; font-weight: 700; }
.avviso { position: fixed; inset-inline: 1rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); z-index: 2147483001; max-width: 30rem; margin: 0 auto; padding: .8rem 1rem; border-radius: 14px; background: #24282f; color: #fff; text-align: center; box-shadow: 0 8px 24px #0009; }
.avviso[hidden] { display: none; }
@media (min-width: 720px) { .griglia { columns: 4 10rem; } }
