/* =====================================================================
   Tema evento "Metti in Play la Tua Storia" — Forum Palermo
   (26 ottobre – 8 novembre, anniversario 25 novembre)
   Caricato DOPO style.css: per tornare al tema MusicBox originale
   basta rimuovere il <link> a questo file dai template.

   Concetto: "Metti in Play" alla lettera. Un vinile gigante è il
   pulsante di partenza; la canzone finita torna come vinile che gira.
   Fondo ambra saturo, nero vinile, carta calda. Poppins come nei
   materiali dell'evento, ma titoli enormi e compatti.
   ===================================================================== */

:root {
    /* Palette della locandina FORUM FEST (ottobre 2026). I nomi storici dei token restano:
       --ev-amber = giallo, --ev-tangerine = rosso, --ev-vinyl = blu notte (inchiostro dei pannelli). */
    --ev-amber: #F7C21B;
    --ev-amber-light: #FFD95A;
    --ev-tangerine: #E7362B;
    --ev-vinyl: #1C2060;
    --ev-groove: #2A2F78;
    --ev-paper: #FFFFFF;
    --ev-red: #E7362B;
    --ev-ink-soft: #3A3F7A;
    --ev-muted: #6B6FA0;
    --ev-line: rgba(28, 32, 96, 0.14);
    --ev-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.55);
    --ev-shadow-soft: 0 12px 28px -16px rgba(0, 0, 0, 0.45);

    /* Blocchi di colore della locandina */
    --ff-navy: #24286B;
    --ff-navy-deep: #1A1D52;
    --ff-blue: #1F8CE0;
    --ff-cyan: #55C3EE;
    --ff-lilac: #B6A3DA;
    --ff-yellow: #F7C21B;
    --ff-red: #E7362B;
    --ff-green: #3BB54A;
    --ff-on-dark: #FFFFFF;
    --ff-on-dark-soft: rgba(255, 255, 255, 0.78);
    --ff-error-on-dark: #FF9B92;
    --ff-disc: #0F1130;
    --ff-disc-groove: #1B1E4A;

    /* Usati da celebrateSongReady() in main.js */
    --note-burst-colors: #F7C21B, #55C3EE, #E7362B, #B6A3DA, #3BB54A, #FFFFFF;
}

/* ---------- Base ---------- */
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    color: var(--ev-vinyl);
    background:
        radial-gradient(120% 60% at 50% 110%, var(--ev-tangerine) 0%, transparent 60%),
        linear-gradient(175deg, var(--ev-amber-light) 0%, var(--ev-amber) 45%, #FF9A38 100%);
    background-attachment: fixed;
}

input,
button,
textarea,
select {
    font-family: inherit;
}

h1 {
    font-weight: 800;
    text-transform: none;
    letter-spacing: -0.03em;
    color: var(--ev-vinyl);
    filter: none;
}

.subtitle {
    color: var(--ev-ink-soft);
    font-weight: 500;
    text-shadow: none;
}

.text-gradient-blue-purple {
    background: none;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: var(--ev-vinyl);
    filter: none;
}

.app-logo {
    filter: drop-shadow(0 6px 12px rgba(110, 40, 0, 0.25));
}

/* ---------- Home ---------- */
.event-home {
    max-width: 1080px;
    min-height: 100vh;
    /* in fondo solo lo spazio dell'equalizzatore (11vh): la home sta tutta in uno schermo del totem */
    padding: 56px 64px 6vh 64px;
    display: flex;
    flex-direction: column;
    text-align: left;
    /* il braccio del giradischi sporge oltre il bordo: niente scorrimento orizzontale */
    overflow-x: clip;
}

.event-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.event-logo {
    height: 96px;
    width: auto;
    filter: drop-shadow(0 6px 12px rgba(110, 40, 0, 0.25));
}

.event-place {
    text-align: right;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ev-vinyl);
}

.event-place span {
    font-weight: 500;
    color: var(--ev-ink-soft);
}

.event-hero {
    margin: 48px 0 8px 0;
}

.event-title {
    font-size: clamp(4.2rem, 11.5vw, 8.4rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    margin: 0 0 22px 0;
    max-width: 9.5ch;
}

.event-lead {
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--ev-ink-soft);
}

/* Il vinile */
.vinyl-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin: 36px auto 0 auto;
    text-decoration: none;
    color: var(--ev-vinyl);
    -webkit-tap-highlight-color: transparent;
}

.vinyl {
    position: relative;
    width: min(82vw, 840px);
    aspect-ratio: 1;
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vinyl-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(255, 255, 255, 0.04) 30.5% 31%, transparent 31.5%),
        repeating-radial-gradient(circle at 50% 50%, var(--ev-vinyl) 0 2px, var(--ev-groove) 2px 4px);
    box-shadow:
        0 50px 90px -40px rgba(90, 25, 0, 0.75),
        inset 0 0 0 12px #120D0B;
    animation: vinylSpin 16s linear infinite;
    will-change: transform;
}

.vinyl-grooves-text {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.groove-line {
    font-family: 'Poppins', sans-serif;
    font-size: 25px;
    font-weight: 600;
    fill: var(--ev-paper);
    opacity: 0.82;
}

.groove-line-soft {
    font-size: 21px;
    font-weight: 500;
    fill: var(--ev-amber-light);
    opacity: 0.7;
}

.vinyl-label {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, var(--ev-amber-light) 0%, var(--ev-amber) 55%, var(--ev-tangerine) 100%);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35);
}

.vinyl-label svg {
    width: 100%;
    height: 100%;
}

.label-line {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    fill: var(--ev-vinyl);
}

.label-line-small {
    font-size: 11.5px;
    font-weight: 600;
}

/* Riflesso fisso sopra i solchi che girano: è ciò che fa sembrare vero il disco */
.vinyl-sheen {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 25deg, transparent 0 7%, rgba(255, 255, 255, 0.13) 12%, transparent 19% 51%, rgba(255, 255, 255, 0.09) 58%, transparent 66%);
    pointer-events: none;
}

/* Tasto play al centro: non gira, pulsa per invitare al tocco */
.vinyl-play {
    position: absolute;
    inset: 40.5%;
    border-radius: 50%;
    background: var(--ev-vinyl);
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 8px var(--ev-paper), 0 18px 30px -10px rgba(0, 0, 0, 0.6);
    transition: transform var(--dur-press) var(--ease-out);
}

.vinyl-play svg {
    width: 46%;
    height: 46%;
    margin-left: 8%;
    fill: var(--ev-amber);
}

.vinyl-play::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--ev-paper);
    animation: playRing 2.4s var(--ease-out) infinite;
    pointer-events: none;
}

@keyframes playRing {
    0% { transform: scale(1); opacity: 0.9; }
    80%, 100% { transform: scale(1.65); opacity: 0; }
}

.vinyl-cta:active .vinyl-play {
    transform: scale(0.94);
}

/* Braccio del giradischi: a riposo fuori dal disco, al tocco si appoggia */
.tonearm {
    position: absolute;
    top: -6%;
    right: -9%;
    width: 30%;
    transform-origin: 80% 10%;
    transform: rotate(-12deg);
    transition: transform 650ms var(--ease-in-out);
    filter: drop-shadow(0 16px 18px rgba(60, 20, 0, 0.45));
    pointer-events: none;
}

.vinyl.is-playing .tonearm {
    transform: rotate(2deg);
}

.vinyl.is-playing .vinyl-play::after {
    animation: none;
    opacity: 0;
}

.tonearm-base {
    fill: var(--ev-paper);
}

.tonearm-pivot {
    fill: var(--ev-vinyl);
}

.tonearm-rod {
    fill: none;
    stroke: var(--ev-paper);
    stroke-width: 11;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tonearm-head {
    fill: var(--ev-vinyl);
    stroke: var(--ev-paper);
    stroke-width: 4;
}

.vinyl-cta-text {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Come funziona: una sequenza vera, quindi numerata, su una linea */
.event-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 56px 0 0 0;
    padding: 0;
    counter-reset: step;
    position: relative;
}

.event-steps::before {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    top: 21px;
    height: 2px;
    background: var(--ev-line);
}

.event-steps li {
    counter-increment: step;
    position: relative;
    text-align: left;
}

.event-steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ev-vinyl);
    color: var(--ev-amber);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 14px;
    position: relative;
}

.event-step-title {
    display: block;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ev-vinyl);
    margin-bottom: 4px;
}

.event-step-text {
    display: block;
    font-size: 0.98rem;
    line-height: 1.4;
    color: var(--ev-ink-soft);
}

.event-note {
    margin: 36px 0 0 0;
    max-width: 46em;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--ev-ink-soft);
}

.event-note strong {
    color: var(--ev-vinyl);
}

@media (max-width: 700px) {
    .event-home {
        padding: 32px 20px 30vh 20px;
    }

    .event-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-steps::before {
        display: none;
    }
}

/* ---------- Equalizzatore ---------- */
.eq-progress-bar {
    background: rgba(26, 20, 17, 0.08);
}

.eq-progress-bar.active {
    background: linear-gradient(to top, rgba(26, 20, 17, 0.35), rgba(26, 20, 17, 0.12));
    box-shadow: none;
    opacity: 0.45;
}

/* In home l'equalizzatore resta sotto i testi: basso e discreto */
.event-home .equalizer-progress-container {
    height: 11vh;
}

/* Intestazione delle pagine interne allineata a sinistra come la home */
.app-header {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    margin-bottom: 40px;
}

.app-logo {
    position: static;
    height: 96px;
}

.app-header-main {
    text-align: left;
}

.app-header header {
    margin-bottom: 0;
}

.app-header h1 {
    font-size: clamp(2.8rem, 7vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

/* ---------- Pagina "Crea la tua canzone" ---------- */
.left-chat-panel,
#wizard-container {
    background: var(--ev-paper);
    border: none;
    border-radius: 32px;
    box-shadow: var(--ev-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.wizard-step-count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ev-muted);
    margin-bottom: 6px;
}

.wizard-question-title {
    color: var(--ev-vinyl);
    text-shadow: none;
    font-weight: 800;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 22px;
}

.question-timer {
    color: var(--ev-ink-soft);
    border-color: var(--ev-line);
    background: transparent;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.question-timer-warning {
    color: var(--ev-paper);
    background: var(--ev-red);
    border-color: var(--ev-red);
}

.chat-bubble-side.bot {
    background: #FFFFFF;
    border: 1px solid var(--ev-line);
    color: var(--ev-ink-soft);
    box-shadow: none;
}

.chat-bubble-side.bot .fa-robot {
    color: var(--ev-tangerine);
}

.chat-bubble-side.user {
    background: var(--ev-vinyl);
    border: 1px solid var(--ev-vinyl);
    color: var(--ev-paper);
    box-shadow: none;
    text-shadow: none;
}

.chat-bubble,
.chat-bubble.system {
    background: #FFFFFF;
    color: var(--ev-ink-soft);
    border-left: 4px solid var(--ev-amber);
}

.option-card-dynamic {
    background: #FFFFFF;
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: 0 2px 0 rgba(110, 40, 0, 0.08), 0 8px 18px -12px rgba(110, 40, 0, 0.35);
    transition: background 120ms ease, color 120ms ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-press) var(--ease-out);
}

.option-label {
    color: var(--ev-vinyl);
    font-weight: 600;
}

.option-desc {
    color: var(--ev-muted);
}

/* Al tocco l'opzione diventa nera come il disco: risposta netta e immediata */
.option-card-dynamic:active {
    background: var(--ev-vinyl);
    border-color: var(--ev-vinyl);
}

.option-card-dynamic:active .option-label {
    color: var(--ev-amber);
}

.option-card-dynamic:active .option-desc {
    color: var(--ev-paper);
}

@media (hover: hover) and (pointer: fine) {
    .option-card-dynamic:hover {
        background: #FFFFFF;
        border-color: var(--ev-amber);
        box-shadow: var(--ev-shadow-soft);
    }
}

.options-scroll-area {
    scrollbar-color: rgba(26, 20, 17, 0.2) transparent;
}

.options-scroll-area::-webkit-scrollbar-thumb,
.ai-lyrics-generator::-webkit-scrollbar-thumb {
    background-color: rgba(26, 20, 17, 0.2);
}

.ai-lyrics-generator::-webkit-scrollbar-track {
    background: transparent;
}

.create-back-link {
    color: var(--ev-vinyl) !important;
    font-weight: 600;
}

/* Totem verticale: pannelli più alti e testi più grandi, per usare tutto lo schermo */
@media (orientation: portrait) {
    .create-page-layout {
        height: auto;
        min-height: 0;
    }

    .left-chat-panel {
        height: 22vh;
        min-height: 240px;
    }

    .right-wizard-panel {
        height: 50vh;
        min-height: 360px;
    }

    .right-wizard-panel.right-wizard-panel-expanded {
        height: 54vh;
    }

    .create-page-layout.player-mode .right-wizard-panel {
        height: auto;
    }

    .wizard-question-title {
        font-size: 2.1rem;
        line-height: 1.15;
    }

    .options-grid-dynamic {
        max-width: 940px;
        gap: 14px;
    }

    .option-card-dynamic {
        min-height: 72px;
        padding: 14px 16px;
    }

    .option-label {
        font-size: 1.05rem;
    }

    .option-desc {
        font-size: 0.88rem;
    }

    .chat-bubble-side {
        font-size: 1rem;
    }

    .privacy-modal {
        max-width: 600px;
        padding: 32px 32px 28px;
    }

    .privacy-modal-subtitle,
    .privacy-checkbox-label {
        font-size: 1rem;
    }

    .wizard-input {
        font-size: 1.05rem;
        padding: 14px 16px;
    }
}

/* Attesa generazione */
.loading-spinner {
    width: 96px;
    height: 96px;
    border: none;
    background:
        radial-gradient(circle, var(--ev-amber) 0 18%, var(--ev-vinyl) 19% 21%, transparent 22%),
        repeating-radial-gradient(circle, var(--ev-vinyl) 0 2px, var(--ev-groove) 2px 4px);
    box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.6);
    animation: spin 1.8s linear infinite;
}

.music-score-staff-line {
    background: linear-gradient(90deg, rgba(26, 20, 17, 0.08), rgba(26, 20, 17, 0.4), rgba(26, 20, 17, 0.08));
}

.music-score-note {
    background: radial-gradient(circle at 30% 30%, #5A463A, var(--ev-vinyl));
    box-shadow: none;
    filter: none !important;
}

.music-score-note::after {
    background: var(--ev-vinyl);
}

/* Pannello "Generazione link in corso" (stili inline in showMusicWaitPanel) */
#music-wait-panel {
    background: var(--ev-vinyl) !important;
    color: var(--ev-paper) !important;
    border: none !important;
    box-shadow: var(--ev-shadow) !important;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

#music-wait-spinner {
    border-color: rgba(255, 246, 234, 0.25) !important;
    border-top-color: var(--ev-amber) !important;
}

/* Canzone pronta */
.song-vinyl-label {
    background-color: var(--ev-amber);
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.4);
}

.music-player-subtitle {
    color: var(--ev-ink-soft);
    font-weight: 600;
    opacity: 1;
}

.event-final {
    max-width: 640px;
    margin: 28px auto 0 auto;
    display: grid;
    gap: 12px;
    text-align: left;
}

.event-final-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
    border-radius: 20px;
    background: #FFFFFF;
    color: var(--ev-ink-soft);
    font-size: 1.05rem;
    line-height: 1.45;
}

.event-final-item i {
    font-size: 1.5rem;
    color: var(--ev-tangerine);
    margin-top: 2px;
}

.event-final-item strong {
    color: var(--ev-vinyl);
}

.event-final-sticker {
    background: var(--ev-vinyl);
    color: var(--ev-paper);
}

.event-final-sticker strong {
    color: var(--ev-amber);
}

.event-final-sticker i {
    color: var(--ev-amber);
}

.song-ready > :nth-child(5) { animation-delay: 480ms; }

/* Copertina creata dall'AI accanto al titolo: schermata finale del totem e pagina /ascolta */
.song-ready-heading,
.listen-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    text-align: left;
}

.song-ready-heading {
    margin-bottom: 22px;
}

.song-ready-heading .wizard-question-title {
    font-size: 2.5rem;
    margin: 0;
    border: none;
}

.song-cover-art,
.listen-cover {
    flex: none;
    width: 132px;
    height: 132px;
    object-fit: cover;
    border-radius: 20px;
    border: 4px solid var(--ev-paper);
    box-shadow: var(--ev-shadow-soft);
    background: var(--ff-navy-deep);
    transform: rotate(-2deg);
}

.listen-heading .listen-title,
.listen-heading .listen-meta {
    margin: 0;
}

.listen-heading-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

@media (max-width: 560px) {
    .song-ready-heading,
    .listen-heading {
        flex-direction: column;
        text-align: center;
    }
    .song-cover-art,
    .listen-cover {
        width: 160px;
        height: 160px;
    }
}

#resend-email-status {
    color: var(--ev-ink-soft) !important;
}

/* ---------- Pulsanti ---------- */
.action-btn.btn-primary,
.timeout-modal-button,
.privacy-button-primary,
.kiosk-idle-button {
    background: var(--ev-vinyl);
    color: var(--ev-paper);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.7);
}

.privacy-button-secondary {
    background: transparent;
    color: var(--ev-vinyl);
    border: 2px solid var(--ev-line);
}

@media (hover: hover) and (pointer: fine) {
    .privacy-button-primary:hover,
    .action-btn.btn-primary:hover {
        background: #000000;
        box-shadow: 0 16px 28px -12px rgba(0, 0, 0, 0.7);
    }

    .privacy-button-secondary:hover {
        background: rgba(26, 20, 17, 0.05);
    }
}

/* ---------- Modali (privacy, timeout, inattività) ---------- */
.privacy-modal-overlay,
.timeout-modal-overlay,
.kiosk-idle-overlay {
    background: rgba(26, 20, 17, 0.55);
}

.privacy-modal,
.timeout-modal,
.kiosk-idle-panel {
    background: var(--ev-paper);
    border: none;
    border-radius: 32px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6);
    color: var(--ev-ink-soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.privacy-modal-title,
.timeout-modal-title,
.kiosk-idle-title {
    color: var(--ev-vinyl);
    text-transform: none;
    letter-spacing: -0.01em;
    font-weight: 800;
}

.privacy-step-title {
    text-transform: none;
    letter-spacing: 0;
    color: var(--ev-vinyl);
    font-size: 1.05rem;
}

.privacy-modal-subtitle,
.privacy-field-label,
.privacy-checkbox-label,
.privacy-note,
.timeout-modal-text,
.kiosk-idle-text {
    color: var(--ev-ink-soft);
}

.privacy-button-primary,
.privacy-button-secondary {
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
}

.privacy-modal-close {
    color: var(--ev-ink-soft);
}

.privacy-step-dot {
    background: rgba(26, 20, 17, 0.12);
    box-shadow: none;
}

.privacy-step-dot-active {
    background: var(--ev-vinyl);
    box-shadow: none;
}

.privacy-checkbox {
    background: #FFFFFF;
    border-color: transparent;
}

.privacy-checkbox-box {
    background: #FFFFFF;
    border-color: var(--ev-ink-soft);
    box-shadow: none;
}

.privacy-checkbox input[type="checkbox"]:checked + .privacy-checkbox-box {
    background: var(--ev-vinyl);
    border-color: var(--ev-vinyl);
    box-shadow: none;
}

.privacy-checkbox input[type="checkbox"]:checked + .privacy-checkbox-box::after {
    border-color: var(--ev-amber);
}

.privacy-error-message {
    color: var(--ev-red);
}

.wizard-input {
    background: #FFFFFF;
    border: 2px solid transparent;
    color: var(--ev-vinyl);
}

.wizard-input::placeholder {
    color: #A8968A;
}

.wizard-input:focus {
    border-color: var(--ev-amber) !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 4px rgba(255, 177, 59, 0.35);
}

.kiosk-idle-count {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: var(--ev-tangerine);
}

.kiosk-idle-button {
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Codice di accesso (modale del totem e pagina di ascolto) ---------- */
.access-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.access-code-input {
    width: 100%;
    min-height: 88px;
    padding: 12px 16px;
    border: 3px solid transparent;
    border-radius: 22px;
    background: #FFFFFF;
    color: var(--ev-vinyl);
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.access-code-input::placeholder {
    color: rgba(26, 20, 17, 0.18);
}

.access-code-input:focus {
    border-color: var(--ev-amber);
    box-shadow: 0 0 0 5px rgba(255, 177, 59, 0.35);
}

.access-code-input[aria-invalid="true"] {
    border-color: var(--ev-red);
}

/* ---------- Codice nella schermata "canzone pronta" ---------- */
.song-code-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 600px;
    margin: 0 auto 28px auto;
    padding: 20px 24px 22px;
    border-radius: 24px;
    background: var(--ev-vinyl);
    color: var(--ev-paper);
}

.song-code-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 246, 234, 0.75);
}

.song-code {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.1;
    color: var(--ev-amber);
    font-variant-numeric: tabular-nums;
}

.song-code-text {
    font-size: 1.05rem;
    line-height: 1.45;
    text-align: center;
}

.song-code-text strong {
    color: var(--ev-paper);
}

/* ---------- Pagina pubblica /ascolta (si apre dal telefono) ---------- */
html:has(body.listen-page) {
    background: #FF9A38;
}

body.listen-page {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
    /* Sui telefoni lo sfondo "fixed" non copre tutta la pagina quando si scorre */
    background-attachment: scroll;
}

.listen {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.listen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.listen-logo {
    height: 64px;
    width: auto;
}

.listen-place {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ev-vinyl);
}

.listen-place span {
    font-weight: 500;
    color: var(--ev-ink-soft);
}

.listen-title {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin: 0;
}

.listen-lead {
    margin-top: 14px;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--ev-ink-soft);
}

.listen-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.listen-label {
    font-weight: 600;
    color: var(--ev-ink-soft);
}

.listen-form .access-code-input {
    min-height: 76px;
    font-size: 2.4rem;
}

.listen-error {
    color: var(--ev-red);
    font-weight: 600;
    line-height: 1.4;
}

.listen-button {
    min-height: 60px;
    border: none;
    border-radius: 999px;
    background: var(--ev-vinyl);
    color: var(--ev-paper);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--dur-press) var(--ease-out);
}

.listen-button:active {
    transform: scale(0.97);
}

.listen-button:focus-visible,
.listen-other:focus-visible,
.listen-lyrics summary:focus-visible {
    outline: 3px solid var(--ev-vinyl);
    outline-offset: 3px;
}

.listen-song {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.listen-vinyl {
    width: min(78vw, 360px);
    margin-bottom: 10px;
}

.listen-meta {
    color: var(--ev-ink-soft);
    font-size: 0.95rem;
}

.listen-audio {
    width: 100%;
    margin-top: 6px;
}

.listen-expiry {
    font-size: 0.95rem;
    color: var(--ev-ink-soft);
}

.listen-lyrics {
    width: 100%;
    text-align: left;
    background: var(--ev-paper);
    border-radius: 20px;
    padding: 16px 20px;
}

.listen-lyrics summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--ev-vinyl);
    min-height: 32px;
    display: flex;
    align-items: center;
}

.listen-lyrics pre {
    margin-top: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--ev-ink-soft);
}

.listen-other {
    align-self: center;
    padding: 12px 16px;
    color: var(--ev-vinyl);
    font-weight: 600;
}

.listen-foot {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ev-ink-soft);
}

/* =====================================================================
   Schermi orizzontali (browser desktop, totem orizzontali, tablet ruotati).
   Il totem verticale non è toccato: queste regole valgono solo in landscape.
   ===================================================================== */
@media (orientation: landscape) and (min-width: 900px) {

    /* ---------- Home: testo a sinistra, vinile a destra ---------- */
    .event-home {
        max-width: none;
        min-height: 100vh;
        padding: 4vh 5vw 10vh 5vw;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "top   top"
            "hero  vinyl"
            "steps vinyl"
            "note  vinyl";
        grid-template-rows: auto 1fr auto auto;
        column-gap: 5vw;
        align-content: center;
    }

    .event-topbar { grid-area: top; }

    .event-hero {
        grid-area: hero;
        align-self: end;
        margin: 2vh 0 0 0;
    }

    .event-title {
        font-size: clamp(3.4rem, 6.4vw, 7.6rem);
        max-width: 11ch;
    }

    .event-lead {
        font-size: clamp(1.2rem, 1.6vw, 1.7rem);
    }

    .vinyl-cta {
        grid-area: vinyl;
        align-self: center;
        margin: 0;
        /* spazio per il braccio del giradischi, che sporge sopra il disco */
        padding-top: 6vh;
        gap: 2.4vh;
    }

    .vinyl {
        width: min(64vh, 42vw);
    }

    .vinyl-cta-text {
        font-size: clamp(1.2rem, 1.5vw, 1.6rem);
    }

    .event-steps {
        grid-area: steps;
        margin-top: 4vh;
    }

    .event-note {
        grid-area: note;
        margin-top: 2.4vh;
    }

    .event-logo {
        height: clamp(64px, 8vh, 96px);
    }

    /* ---------- Pagina Crea: chat a sinistra, domande a destra ---------- */
    .app-header {
        margin-bottom: 2.4vh;
    }

    .app-logo {
        height: clamp(56px, 7vh, 88px);
    }

    .app-header h1 {
        font-size: clamp(2.2rem, 3.6vw, 3.6rem);
    }

    .app-header .subtitle {
        font-size: clamp(1rem, 1.2vw, 1.3rem);
    }

    .create-page-layout {
        flex-direction: row;
        align-items: stretch;
        max-width: 1560px;
        height: calc(100vh - 13vh - 110px);
        min-height: 420px;
        gap: 24px;
    }

    .left-chat-panel {
        width: 34%;
        max-width: none;
        height: auto;
    }

    .right-wizard-panel,
    .right-wizard-panel.right-wizard-panel-expanded {
        flex: 1;
        width: auto;
        max-width: none;
        height: auto;
    }

    .wizard-question-title {
        font-size: clamp(1.4rem, 2vw, 2rem);
        line-height: 1.2;
    }

    .options-grid-dynamic {
        max-width: none;
        gap: 12px;
    }

    .option-card-dynamic {
        min-height: 64px;
    }

    .option-label {
        font-size: clamp(0.9rem, 1vw, 1.05rem);
    }

    /* Canzone pronta: vinile a sinistra, codice e messaggi a destra */
    .create-page-layout.player-mode {
        height: auto;
    }

    .song-ready {
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        grid-template-areas:
            "title  title"
            "player code"
            "player final";
        grid-template-rows: auto auto 1fr;
        column-gap: 48px;
        row-gap: 20px;
        align-items: start;
        padding: 28px 40px !important;
    }

    .song-ready > .song-ready-heading {
        grid-area: title;
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .song-ready-heading .wizard-question-title {
        font-size: clamp(1.8rem, 2.6vw, 2.5rem) !important;
    }

    .song-cover-art {
        width: clamp(110px, 9vw, 150px);
        height: clamp(110px, 9vw, 150px);
    }

    .song-ready > .song-code-card,
    .song-ready > .chat-bubble {
        grid-area: code;
        margin: 0 !important;
        max-width: none !important;
    }

    .song-ready > .song-player {
        grid-area: player;
        margin: 0;
    }

    .song-ready > .event-final {
        grid-area: final;
        margin: 0;
        max-width: none;
    }

    .create-container {
        max-width: min(94vw, 2100px);
    }

    .create-page-layout.player-mode .right-wizard-panel {
        max-width: 1500px;
    }

    .song-ready .song-vinyl {
        width: min(46vh, 28vw);
        max-width: 100%;
    }

    /* ---------- Pagina /ascolta da desktop ---------- */
    .listen {
        max-width: 1120px;
        padding: 40px 48px 56px;
    }

    .listen-search {
        width: 100%;
        max-width: 600px;
        margin: 4vh auto 0 auto;
    }

    .listen-song {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "vinyl heading"
            "vinyl audio"
            "vinyl expiry"
            "vinyl lyrics";
        grid-template-rows: auto auto auto 1fr;
        column-gap: 56px;
        row-gap: 14px;
        align-items: start;
        text-align: left;
    }

    .listen-vinyl {
        grid-area: vinyl;
        width: min(60vh, 440px);
        margin: 0;
    }

    .listen-song .listen-heading { grid-area: heading; justify-content: flex-start; }
    .listen-song .listen-cover { width: 150px; height: 150px; }
    .listen-song .listen-audio { grid-area: audio; }
    .listen-song .listen-expiry { grid-area: expiry; }
    .listen-song .listen-lyrics { grid-area: lyrics; }

    .listen-other,
    .listen-foot {
        align-self: flex-start;
    }
}

/* Schermi orizzontali bassi (portatili 1366x768 e simili): meno aria in verticale */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 820px) {
    .event-steps li::before {
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
    }

    .event-step-text {
        font-size: 0.88rem;
    }

    .event-note {
        font-size: 0.95rem;
    }

    .option-card-dynamic {
        min-height: 56px;
        padding: 10px 12px;
    }
}

/* Schermi orizzontali molto grandi (2K/4K): tutto ciò che è in rem cresce in proporzione */
@media (orientation: landscape) and (min-width: 2200px) {
    html {
        font-size: 125%;
    }
}

/* =====================================================================
   Step dell'utente: biglietto del codice, domande a sticker, attesa, canzone pronta
   ===================================================================== */

/* ---------- Biglietto del codice ---------- */
.access-modal.ticket {
    max-width: 620px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    max-height: none;
    position: relative;
    filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.45));
}

/* Le due metà del biglietto hanno le "tacche" sulla linea di strappo */
.ticket-head,
.ticket-body {
    --notch: 18px;
}

.ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 28px 30px;
    background: var(--ev-vinyl);
    border-radius: 28px 28px 0 0;
    -webkit-mask:
        radial-gradient(circle var(--notch) at 0 100%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 100%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
    mask:
        radial-gradient(circle var(--notch) at 0 100%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 100%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
}

.ticket-head .privacy-modal-title {
    color: var(--ev-paper);
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    margin: 0;
}

.ticket-head .privacy-modal-close {
    color: var(--ev-paper);
}

.ticket-body {
    position: relative;
    padding: 28px;
    background: var(--ev-paper);
    border-radius: 0 0 28px 28px;
    -webkit-mask:
        radial-gradient(circle var(--notch) at 0 0, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 0, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
    mask:
        radial-gradient(circle var(--notch) at 0 0, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 0, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
}

/* Linea di strappo */
.ticket-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    border-top: 3px dashed rgba(26, 20, 17, 0.22);
}

/* 6 caselle del codice; il campo vero è trasparente sopra di esse */
.code-field {
    position: relative;
    margin: 8px 0 4px;
}

.code-slots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.code-slot {
    width: clamp(48px, 9vw, 68px);
    height: clamp(64px, 12vw, 88px);
    border-radius: 16px;
    background: #FFFFFF;
    border: 3px solid rgba(26, 20, 17, 0.12);
    display: grid;
    place-items: center;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 4.4vw, 2.7rem);
    font-weight: 800;
    color: var(--ev-vinyl);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.code-slot.is-filled {
    border-color: var(--ev-vinyl);
}

.code-slot.is-current {
    border-color: var(--ev-amber);
    box-shadow: 0 0 0 5px rgba(255, 177, 59, 0.3);
}

/* Cursore lampeggiante nella prossima casella da riempire */
.code-slot.is-current::after {
    content: "";
    width: 3px;
    height: 46%;
    border-radius: 2px;
    background: var(--ev-vinyl);
    animation: caretBlink 1s steps(1) infinite;
}

@keyframes caretBlink {
    50% { opacity: 0; }
}

.code-slot.is-pop {
    animation: slotPop 240ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes slotPop {
    from { transform: scale(0.72); }
    to { transform: scale(1); }
}

.code-dash {
    font-size: 2.2rem;
    font-weight: 800;
    color: rgba(26, 20, 17, 0.3);
}

.code-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    font-size: 16px;
    caret-color: transparent;
    cursor: text;
}

.code-field.is-error {
    animation: ticketShake 420ms ease-in-out;
}

.code-field.is-error .code-slot {
    border-color: var(--ev-red);
}

@keyframes ticketShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
}

/* Codice valido: caselle ambra e timbro "Valido" */
.access-modal.is-valid .code-slot {
    background: var(--ev-amber);
    border-color: var(--ev-vinyl);
}

.ticket-stamp {
    position: absolute;
    right: 36px;
    top: 104px;
    padding: 6px 20px;
    border: 5px solid var(--ev-red);
    border-radius: 12px;
    background: rgba(255, 246, 234, 0.9);
    color: var(--ev-red);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: rotate(-14deg) scale(1.8);
    pointer-events: none;
}

.access-modal.is-valid .ticket-stamp {
    animation: stampIn 380ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes stampIn {
    from { opacity: 0; transform: rotate(-14deg) scale(1.8); }
    to { opacity: 1; transform: rotate(-14deg) scale(1); }
}

/* ---------- Domande: tracklist, timer ad anello, opzioni a sticker ---------- */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.wizard-progress .wizard-step-count {
    margin: 0;
}

.wizard-tracks {
    display: flex;
    gap: 6px;
}

.wizard-track {
    width: 26px;
    height: 8px;
    border-radius: 999px;
    background: rgba(26, 20, 17, 0.12);
}

.wizard-track.is-done {
    background: var(--ev-vinyl);
}

.wizard-track.is-current {
    width: 54px;
    background: linear-gradient(90deg, var(--ev-amber), var(--ev-tangerine));
    animation: trackGrow 420ms var(--ease-out);
}

@keyframes trackGrow {
    from { width: 26px; }
}

/* La domanda nuova entra da destra, come il brano successivo */
.wizard-question-header {
    animation: trackIn 340ms var(--ease-out) backwards;
}

@keyframes trackIn {
    from { opacity: 0; transform: translateX(32px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Timer: anello che si svuota (--p da 1 a 0, aggiornato ogni secondo da main.js) */
@property --p {
    syntax: '<number>';
    inherits: false;
    initial-value: 1;
}

.question-timer,
.question-timer.question-timer-warning {
    width: 78px;
    height: 78px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ev-vinyl);
    background:
        radial-gradient(closest-side, var(--ev-paper) calc(100% - 8px), transparent calc(100% - 7px)),
        conic-gradient(var(--ev-vinyl) calc(var(--p) * 1turn), rgba(26, 20, 17, 0.12) 0);
    transition: --p 1s linear;
    animation: none;
}

.question-timer.question-timer-warning {
    color: var(--ev-red);
    background:
        radial-gradient(closest-side, var(--ev-paper) calc(100% - 8px), transparent calc(100% - 7px)),
        conic-gradient(var(--ev-red) calc(var(--p) * 1turn), rgba(201, 54, 27, 0.15) 0);
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    50% { transform: scale(1.07); }
}

/* Opzioni come sticker: bordo bianco "fustellato", leggera rotazione, toni caldi alternati */
.options-grid-dynamic > .option-card-dynamic {
    animation: stickerIn 340ms var(--ease-out) backwards;
}

@keyframes stickerIn {
    from { opacity: 0; transform: translateY(16px) scale(0.88) rotate(calc(var(--r, 0deg) * 4)); }
    to { opacity: 1; transform: rotate(var(--r, 0deg)); }
}

.option-card-dynamic {
    transform: rotate(var(--r, 0deg));
    border: 0;
    box-shadow: 0 0 0 3px #FFFFFF, 0 12px 20px -12px rgba(110, 40, 0, 0.5);
    transition: background 120ms ease, opacity 220ms ease, box-shadow var(--dur-fast) ease, transform 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.options-grid-dynamic > .option-card-dynamic:nth-child(5n+2) { background: #FFF1DC; }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+3) { background: #FFE6BF; }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+4) { background: #FFE2CF; }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+5) { background: #FFF7EC; }

.option-card-dynamic:active {
    transform: rotate(0deg) scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
    .option-card-dynamic:hover {
        transform: rotate(0deg) translateY(-3px);
        border: 0;
        box-shadow: 0 0 0 3px var(--ev-amber), 0 16px 24px -12px rgba(110, 40, 0, 0.5);
    }
}

/* Scelta fatta: lo sticker scelto si raddrizza, diventa nero con la spunta; gli altri si spengono */
.options-grid-dynamic.is-deciding {
    pointer-events: none;
}

.options-grid-dynamic.is-deciding .option-card-dynamic:not(.is-chosen) {
    opacity: 0.28;
    transform: rotate(var(--r, 0deg)) scale(0.94);
}

.options-grid-dynamic .option-card-dynamic.is-chosen {
    background: var(--ev-vinyl);
    transform: rotate(0deg) scale(1.07);
    box-shadow: 0 0 0 4px var(--ev-amber), 0 20px 32px -14px rgba(0, 0, 0, 0.55);
    z-index: 2;
}

.option-card-dynamic.is-chosen .option-label {
    color: var(--ev-amber);
}

.option-card-dynamic.is-chosen .option-desc {
    color: var(--ev-paper);
}

.option-card-dynamic.is-chosen::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ev-amber);
    color: var(--ev-vinyl);
    font-size: 0.85rem;
    font-weight: 800;
    animation: slotPop 240ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

/* Risposte nella chat: anche loro sticker */
.chat-bubble-side.user {
    transform: rotate(-1.5deg);
    animation: bubblePop 340ms cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}

@keyframes bubblePop {
    from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
    to { opacity: 1; transform: rotate(-1.5deg); }
}

/* ---------- Attesa della generazione ---------- */
.gen-stage {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 24px;
    text-align: center;
}

.gen-vinyl {
    width: min(30vh, 460px);
    flex-shrink: 0;
}

.gen-vinyl .song-vinyl-label {
    background: radial-gradient(circle at 50% 40%, var(--ev-amber-light), var(--ev-amber) 55%, var(--ev-tangerine));
}

.gen-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.gen-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ev-vinyl);
    line-height: 1.1;
}

.gen-status {
    min-height: 1.6em;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ev-ink-soft);
    transition: opacity 250ms ease, transform 250ms var(--ease-out);
}

.gen-status.is-changing {
    opacity: 0;
    transform: translateY(-6px);
}

.gen-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 4px 0 0 0;
}

.gen-steps li {
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(26, 20, 17, 0.08);
    color: var(--ev-muted);
    font-weight: 700;
    font-size: 1rem;
    transition: background 300ms ease, color 300ms ease;
}

.gen-steps li.is-active {
    background: var(--ev-amber);
    color: var(--ev-vinyl);
    animation: stepPulse 1.4s ease-in-out infinite;
}

.gen-steps li.is-done {
    background: var(--ev-vinyl);
    color: var(--ev-paper);
}

.gen-steps li.is-done::before {
    content: "✓ ";
    color: var(--ev-amber);
}

@keyframes stepPulse {
    50% { box-shadow: 0 0 0 6px rgba(255, 177, 59, 0.35); }
}

.gen-hint {
    font-size: 0.95rem;
    color: var(--ev-muted);
    max-width: 34em;
}

/* Conto alla rovescia finale: al centro in basso invece che nell'angolo */
#music-wait-panel {
    left: 50% !important;
    right: auto !important;
    bottom: 13vh !important;
    transform: translateX(-50%);
    max-width: min(92vw, 600px) !important;
    padding: 16px 28px !important;
    border-radius: 999px !important;
}

#music-wait-text {
    font-size: 1.1rem !important;
    font-weight: 600;
}

/* ---------- Braccio del giradischi sul vinile della canzone ---------- */
.song-vinyl {
    position: relative;
}

.song-vinyl.is-playing .tonearm {
    transform: rotate(2deg);
}

/* Codice finale come biglietto, con le tacche ai lati */
.song-code-card {
    --notch: 16px;
    -webkit-mask:
        radial-gradient(circle var(--notch) at 0 50%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 50%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
    mask:
        radial-gradient(circle var(--notch) at 0 50%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 50%, transparent calc(var(--notch) - 0.5px), #000 var(--notch)) right / 51% 100% no-repeat;
}

/* ---------- Orizzontale: attesa con vinile e testi affiancati ---------- */
@media (orientation: landscape) and (min-width: 900px) {
    .gen-stage {
        flex-direction: row;
        gap: 56px;
        text-align: left;
    }

    .gen-text {
        align-items: flex-start;
    }

    .gen-steps {
        justify-content: flex-start;
    }

    .gen-vinyl {
        width: min(42vh, 30vw);
    }
}

/* ---------- Giradischi di sfondo nelle pagine interne ---------- */
/* Grande, in parte fuori schermo e a bassa opacità: dà profondità senza disturbare la lettura */
.bg-turntable {
    position: fixed;
    z-index: 0;
    width: min(118vw, 74vh);
    aspect-ratio: 1;
    right: -38vw;
    top: -8vh;
    opacity: 0.16;
    pointer-events: none;
}

.bg-turntable-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(circle at 50% 50%, var(--ev-vinyl) 0 2px, var(--ev-groove) 2px 4px);
    animation: vinylSpin 40s linear infinite;
    will-change: transform;
}

.bg-turntable-disc svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bg-turntable-label {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: var(--ev-amber);
}

/* Il braccio resta appoggiato: il disco "suona" per tutto il percorso */
.bg-turntable .tonearm {
    transform: rotate(2deg);
}

@media (orientation: landscape) and (min-width: 900px) {
    .bg-turntable {
        width: 96vh;
        right: -30vh;
        top: auto;
        bottom: -38vh;
        opacity: 0.14;
    }
}

/* =====================================================================
   Palette FORUM FEST (dalla locandina dell'evento, ottobre 2026)
   Fondo blu notte, blocchi di colore (ciano, lilla, giallo, rosso, verde, azzurro),
   testi bianchi sul fondo e blu notte nei pannelli bianchi.
   ===================================================================== */

html {
    background: var(--ff-navy-deep);
}

body,
body.listen-page {
    color: var(--ff-on-dark);
    background:
        radial-gradient(120% 55% at 50% 0%, #2E3385 0%, transparent 60%),
        linear-gradient(180deg, var(--ff-navy) 0%, var(--ff-navy-deep) 100%);
    background-attachment: fixed;
}

html:has(body.listen-page) {
    background: var(--ff-navy-deep);
}

body.listen-page {
    background-attachment: scroll;
}

/* Striscia di blocchi colorati in alto, come le colonne della locandina */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 30;
    pointer-events: none;
    background: linear-gradient(90deg,
        var(--ff-green) 0 16.66%, var(--ff-lilac) 16.66% 33.33%, var(--ff-red) 33.33% 50%,
        var(--ff-blue) 50% 66.66%, var(--ff-cyan) 66.66% 83.33%, var(--ff-yellow) 83.33% 100%);
}

/* ---------- Testi direttamente sul fondo: bianchi ---------- */
h1,
.text-gradient-blue-purple {
    color: var(--ff-on-dark);
}

.subtitle,
.event-lead,
.listen-lead,
.listen-meta,
.listen-expiry,
.listen-foot,
.listen-label {
    color: var(--ff-on-dark-soft);
}

.event-place,
.listen-place {
    color: var(--ff-on-dark);
}

.event-place span,
.listen-place span {
    color: var(--ff-cyan);
}

/* Titolo a parole colorate, come "METTI IN PLAY LA TUA STORIA" della locandina */
.ff-word-cyan { color: var(--ff-cyan); }
.ff-word-lilac { color: var(--ff-lilac); }
.ff-word-yellow { color: var(--ff-yellow); }

.vinyl-cta-text {
    color: var(--ff-yellow);
}

.event-steps::before {
    background: rgba(255, 255, 255, 0.22);
}

.event-steps li::before {
    color: var(--ev-vinyl);
    background: var(--ff-cyan);
}

.event-steps li:nth-child(2)::before { background: var(--ff-lilac); }
.event-steps li:nth-child(3)::before { background: var(--ff-yellow); }
.event-steps li:nth-child(4)::before { background: var(--ff-green); }

.event-step-title {
    color: var(--ff-on-dark);
}

.event-step-text,
.event-note {
    color: var(--ff-on-dark-soft);
}

.event-note strong {
    color: var(--ff-yellow);
}

.create-back-link,
.listen-other {
    color: var(--ff-on-dark) !important;
}

.listen-error {
    color: var(--ff-error-on-dark);
}

/* ---------- Vinile della home: disco scuro staccato dal fondo, etichetta e play della locandina ---------- */
.vinyl-disc {
    background:
        radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(255, 255, 255, 0.05) 30.5% 31%, transparent 31.5%),
        repeating-radial-gradient(circle at 50% 50%, var(--ff-disc) 0 2px, var(--ff-disc-groove) 2px 4px);
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.06),
        0 50px 90px -40px rgba(0, 0, 0, 0.8),
        inset 0 0 0 12px #0A0B24;
}

.groove-line {
    fill: var(--ff-on-dark);
}

.groove-line-soft {
    fill: var(--ff-yellow);
}

/* Etichetta rossa con anello verde, come il tasto play della locandina */
.vinyl-label {
    background: var(--ff-red);
    box-shadow: 0 0 0 6px var(--ff-green), 0 0 0 9px rgba(0, 0, 0, 0.35);
}

.label-line {
    fill: var(--ff-on-dark);
}

.vinyl-play {
    background: var(--ff-blue);
    box-shadow: 0 0 0 8px var(--ff-on-dark), 0 18px 30px -10px rgba(0, 0, 0, 0.6);
}

.vinyl-play svg {
    fill: #D6F2FD;
}

.vinyl-play::after {
    border-color: var(--ff-yellow);
}

/* Vinili di attesa, canzone pronta e pagina di ascolto */
.song-vinyl-disc {
    background: repeating-radial-gradient(circle at 50% 50%, var(--ff-disc) 0 2px, var(--ff-disc-groove) 2px 4px);
}

/* Rosso pieno al posto del gradiente ambra di base; la copertina (stile inline) resta sopra */
.song-vinyl-label,
.gen-vinyl .song-vinyl-label {
    background: var(--ff-red) center / cover no-repeat;
    box-shadow: 0 0 0 4px var(--ff-green);
}

.gen-vinyl .song-vinyl-label {
    background: var(--ff-red);
}

/* Giradischi di sfondo della pagina Crea: più visibile sul blu */
.bg-turntable {
    opacity: 0.32;
}

.bg-turntable-disc {
    background: repeating-radial-gradient(circle at 50% 50%, var(--ff-disc) 0 2px, var(--ff-disc-groove) 2px 4px);
}

.bg-turntable-label {
    background: var(--ff-red);
}

@media (orientation: landscape) and (min-width: 900px) {
    .bg-turntable {
        opacity: 0.28;
    }
}

/* ---------- Equalizzatore: barre nei colori della locandina ---------- */
.eq-progress-bar {
    background: rgba(255, 255, 255, 0.06);
}

.eq-progress-bar.active {
    background: var(--ff-cyan);
    opacity: 0.5;
}

.eq-progress-bar.active:nth-child(6n+2) { background: var(--ff-lilac); }
.eq-progress-bar.active:nth-child(6n+3) { background: var(--ff-yellow); }
.eq-progress-bar.active:nth-child(6n+4) { background: var(--ff-red); }
.eq-progress-bar.active:nth-child(6n+5) { background: var(--ff-green); }
.eq-progress-bar.active:nth-child(6n+6) { background: var(--ff-blue); }

/* ---------- Domande: sticker nei colori della locandina ---------- */
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+1) { background: #FFFFFF; }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+2) { background: var(--ff-cyan); }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+3) { background: var(--ff-yellow); }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+4) { background: var(--ff-lilac); }
.options-grid-dynamic > .option-card-dynamic:nth-child(5n+5) { background: var(--ff-green); }

.option-label {
    color: var(--ev-vinyl);
}

.option-desc {
    color: var(--ev-ink-soft);
}

/* Scelta fatta: sticker rosso con spunta gialla */
.options-grid-dynamic .option-card-dynamic.is-chosen {
    background: var(--ff-red);
    box-shadow: 0 0 0 4px var(--ff-yellow), 0 20px 32px -14px rgba(0, 0, 0, 0.55);
}

.option-card-dynamic.is-chosen .option-label {
    color: var(--ff-on-dark);
}

.option-card-dynamic.is-chosen .option-desc {
    color: rgba(255, 255, 255, 0.88);
}

.wizard-track.is-current {
    background: linear-gradient(90deg, var(--ff-yellow), var(--ff-red));
}

/* ---------- Biglietto del codice: testata rossa, timbro verde ---------- */
.ticket-head {
    background: var(--ff-red);
}

.ticket-stamp {
    border-color: var(--ff-green);
    color: #1F8A2E;
}

.access-modal.is-valid .code-slot {
    background: var(--ff-yellow);
}

.privacy-modal-overlay,
.timeout-modal-overlay,
.kiosk-idle-overlay {
    background: rgba(10, 12, 40, 0.68);
}

/* ---------- Pulsanti sul fondo blu: gialli ---------- */
.listen-button {
    background: var(--ff-yellow);
    color: var(--ev-vinyl);
}

.listen-button:focus-visible,
.listen-other:focus-visible,
.listen-lyrics summary:focus-visible {
    outline-color: var(--ff-yellow);
}

/* Conto alla rovescia finale: pillola gialla ben visibile sul blu */
#music-wait-panel {
    background: var(--ff-yellow) !important;
    color: var(--ev-vinyl) !important;
}

#music-wait-spinner {
    border-color: rgba(28, 32, 96, 0.25) !important;
    border-top-color: var(--ev-vinyl) !important;
}

/* Codice finale: biglietto blu notte con codice giallo */
.song-code-card {
    background: var(--ev-vinyl);
}

.song-code {
    color: var(--ff-yellow);
}

.event-final-sticker {
    background: var(--ff-red);
    color: var(--ff-on-dark);
}

.event-final-sticker strong,
.event-final-sticker i {
    color: var(--ff-yellow);
}

.event-final-item i {
    color: var(--ff-blue);
}

.gen-steps li.is-done {
    background: var(--ff-green);
    color: var(--ev-vinyl);
}

.gen-steps li.is-done::before {
    color: var(--ev-vinyl);
}

.chat-bubble-side.bot .fa-robot {
    color: var(--ff-blue);
}

.kiosk-idle-count {
    color: var(--ff-red);
}

/* ---------- Domanda precedente ---------- */
.wizard-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border: 2px solid var(--ev-vinyl);
    background: var(--ev-paper);
    color: var(--ev-vinyl);
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 120ms var(--ease-out), background-color 150ms ease;
}

.wizard-back:active {
    transform: scale(0.96);
    background: var(--ff-yellow);
}

@media (hover: hover) and (pointer: fine) {
    .wizard-back:hover { background: rgba(247, 194, 27, 0.25); }
}

.wizard-back:focus-visible {
    outline: 3px solid var(--ff-cyan);
    outline-offset: 2px;
}

/* ---------- Creazione in corso: schermo bloccato fino al player ---------- */
.creation-lock {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: transparent;
    touch-action: none;
    cursor: progress;
}

.creation-lock-toast {
    position: absolute;
    left: 50%;
    bottom: 7vh;
    max-width: min(90vw, 640px);
    padding: 16px 26px;
    border-radius: 999px;
    border: 2px solid var(--ff-yellow);
    background: var(--ff-navy-deep);
    color: var(--ff-on-dark);
    font-weight: 600;
    text-align: center;
    box-shadow: var(--ev-shadow);
    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity 200ms ease, transform 240ms var(--ease-out);
    pointer-events: none;
}

.creation-lock-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.is-creating .create-back-link {
    opacity: 0.3;
}
