:root {
            --bg-color: #0b0b0f;
            --bg-gradient: linear-gradient(135deg, #0b0b0f 0%, #161622 100%);
            --card-bg: #13131a;
            --accent-color: #ff2a2a;
            --accent-hover: #ff5555;
            --text-color: #f5f5fa;
            --text-muted: #b0b0bd;
            --tier-s: #ff6a00;
            --tier-a: #ffd200;
            --tier-b: #00bfff;
            --tier-c: #00ff7f;
            --legendary-color: #ffd700;
            --shadow-glow: 0 0 15px rgba(255, 42, 42, 0.4);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
        }

        html {
			background: var(--bg-gradient);
		background-color: var(--bg-color); /* fallback per overscroll */
		min-height: 100%;
}

		body {
			background: var(--bg-gradient);
			background-color: var(--bg-color);
			color: var(--text-color);
			line-height: 1.6;
			padding: 15px;
			display: flex;
			flex-direction: column;
			min-height: 100vh;
			overscroll-behavior-y: none; /* disabilita il rimbalzo elastico */
}

        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 10px;
            flex: 1;
            width: 100%;
        }

        header {
            text-align: center;
            padding: 60px 0 25px 0;
            border-bottom: 3px solid transparent;
            border-image: linear-gradient(to right, transparent, var(--accent-color), transparent) 1;
            margin-bottom: 30px;
        }

        h1 {
            font-family: 'Arial Black', 'Segoe UI', sans-serif;
            font-size: 3.675rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 3px;
            color: #ffffff;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 3px 3px 0px var(--accent-color);
            line-height: 1;
        }

        .subtitle {
            font-size: 1.1rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 3px;
            color: var(--text-muted);
            margin-top: 10px;
        }

        @media (max-width: 600px) {
            body { padding-top: 8px; }
            .container { padding-top: 4px; }
            header { padding-top: 2px; }
            h1 { font-size: 2.31rem; text-shadow: 2px 2px 0px var(--accent-color); }
            .subtitle { font-size: 0.85rem; letter-spacing: 1.5px; }
        }

        .lang-selector-container {
            margin-top: 20px;
            text-align: right;
        }
        .lang-selector {
            width: auto;
            display: inline-block;
            padding: 6px 12px;
            font-size: 0.85rem;
            background: #1c1c24;
            border: 1px solid #333344;
            color: #fff;
            border-radius: 6px;
            cursor: pointer;
            transition: border 0.2s;
        }
        .lang-selector:focus {
            border-color: var(--accent-color);
            outline: none;
        }

        .screen {
            display: none;
        }

        .screen.active {
            display: block;
            animation: fadeIn 0.4s ease-in-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .panel {
            background: var(--card-bg);
            padding: 25px;
            border-radius: 12px;
            margin-bottom: 25px;
            border: 1px solid #222232;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        }

        h3 {
            font-size: 1.4rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 15px;
            color: #fff;
        }

        label {
            display: block;
            margin-top: 18px;
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        input, select {
            width: 100%;
            padding: 14px;
            margin-top: 6px;
            background: #171724;
            border: 1px solid #2d2d3f;
            color: #fff;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.2s;
        }

        input:focus, select:focus {
            border-color: var(--accent-color);
            box-shadow: 0 0 8px rgba(255, 42, 42, 0.2);
            outline: none;
        }

        button {
            display: inline-block;
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, var(--accent-color) 0%, #b30000 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            font-size: 1.1rem;
            cursor: pointer;
            margin-top: 25px;
            text-transform: uppercase;
            letter-spacing: 1px;
            box-shadow: 0 4px 12px rgba(211, 0, 0, 0.3);
            transition: all 0.2s ease;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-glow);
        }

        button:active {
            transform: translateY(0);
        }

        button:disabled {
            background: #222232;
            color: #555566;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }

        .rules-list {
            list-style: none;
            padding: 0;
        }
        .rules-list li {
            margin-bottom: 12px;
            padding-left: 30px;
            position: relative;
            font-size: 0.95rem;
        }
        .rules-list li::before {
            content: "🤘";
            position: absolute;
            left: 0;
            top: 0;
            filter: drop-shadow(0 0 2px var(--accent-color));
        }

        .hud {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
            margin-bottom: 25px;
            background: rgba(19, 19, 26, 0.8);
            backdrop-filter: blur(8px);
            padding: 20px;
            padding-right: 60px; /* riserva spazio per il bottone home in alto a destra */
            border-radius: 12px;
            font-size: 1.05rem;
            border: 1px solid #222232;
            position: relative;
        }
        .hud div span {
            font-weight: bold;
            color: var(--accent-color);
        }
        /* Evidenzia il budget rimanente */
        .hud #hud-budget {
            font-size: 1.25rem;
            color: var(--tier-c);
            text-shadow: 0 0 8px rgba(0, 255, 127, 0.35);
            letter-spacing: 0.5px;
        }

        .hud-restart-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 34px;
            height: 34px;
            padding: 0;
            margin-top: 0;
            font-size: 1.15rem;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: #222232;
            color: var(--text-muted);
            border: 1px solid #333344;
            box-shadow: none;
            border-radius: 50%;
            cursor: pointer;
            opacity: 0.75;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: clip;
            flex-shrink: 0;
            transition: opacity 0.2s, background 0.2s, color 0.2s, transform 0.2s;
        }
        .hud-restart-btn:hover {
            background: var(--accent-color);
            color: #fff;
            border-color: var(--accent-hover);
            opacity: 1;
            transform: rotate(-90deg);
        }
        @media (max-width: 600px) {
            .hud {
                font-size: 1rem;
                padding: 16px;
                padding-right: 46px;
                gap: 10px;
            }
            .hud #hud-budget { font-size: 1.15rem; }
            .hud-restart-btn {
                width: 28px;
                height: 28px;
                font-size: 1rem;
                top: 6px;
                right: 6px;
            }
        }

        .lineup-slots {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-top: 15px;
            margin-bottom: 30px;
        }
        @media (max-width: 480px) {
            .lineup-slots { grid-template-columns: repeat(2, 1fr); }
        }
        .slot {
            background: rgba(11, 11, 15, 0.6);
            border: 2px dashed #2d2d3f;
            border-radius: 10px;
            padding: 18px 12px;
            text-align: center;
            font-size: 0.85rem;
            min-height: 110px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
            transition: all 0.2s;
        }
        .slot.filled {
            border-style: solid;
            border-color: #333344;
            background: var(--card-bg);
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }
        .slot.is-legendary {
            border-color: var(--legendary-color);
            box-shadow: 0 0 12px rgba(255, 215, 0, 0.15), inset 0 0 8px rgba(255, 215, 0, 0.1);
        }
        .slot .band-name { font-weight: bold; color: #fff; font-size: 1rem; }
        .slot .band-genre { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

        .draft-title {
            margin-bottom: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .reroll-btn {
            width: auto;
            margin-top: 0;
            padding: 8px 20px;
            font-size: 0.9rem;
            background: #222232;
            border: 1px solid #333344;
            box-shadow: none;
        }
        .reroll-btn:hover { background: #2d2d3f; border-color: var(--text-muted); box-shadow: none; }
        
        .choices-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
        }
        @media (min-width: 600px) {
            .choices-grid { grid-template-columns: repeat(2, 1fr); }
        }

        .band-card {
            background: var(--card-bg);
            border: 1px solid #222232;
            border-radius: 12px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            overflow: hidden;
            box-shadow: 0 6px 16px rgba(0,0,0,0.4);
            transition: transform 0.2s, border-color 0.2s;
        }
        .band-card:hover {
            transform: translateY(-4px);
            border-color: #3d3d5c;
        }
        .band-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
        }
        .band-card.tier-S::before { background-color: var(--tier-s); }
        .band-card.tier-A::before { background-color: var(--tier-a); }
        .band-card.tier-B::before { background-color: var(--tier-b); }
        .band-card.tier-C::before { background-color: var(--tier-c); }

        .band-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
            gap: 5px;
        }
        
        /* EVIDENZIAMENTO DEL NOME DELLA BAND */
        .band-title { 
            font-weight: 800; 
            font-size: 1.45rem; 
            color: #ffffff;
            letter-spacing: 0.5px;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
        }
        
        .band-tier {
            font-size: 0.75rem;
            padding: 3px 8px;
            border-radius: 20px;
            font-weight: bold;
            background: #171724;
            white-space: nowrap;
            border: 1px solid #2d2d3f;
        }
        .tier-S .band-tier { color: var(--tier-s); border-color: rgba(255, 106, 0, 0.3); }
        .tier-A .band-tier { color: var(--tier-a); border-color: rgba(255, 210, 0, 0.3); }
        .tier-B .band-tier { color: var(--tier-b); border-color: rgba(0, 191, 255, 0.3); }
        .tier-C .band-tier { color: var(--tier-c); border-color: rgba(0, 255, 127, 0.3); }

        .legendary-tag {
            background: rgba(255, 215, 0, 0.08);
            color: var(--legendary-color);
            border: 1px solid rgba(255, 215, 0, 0.3);
            font-size: 0.75rem;
            font-weight: bold;
            padding: 4px 10px;
            border-radius: 6px;
            margin-bottom: 12px;
            display: inline-block;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .band-details {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 15px;
        }
        .band-details div {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
            border-bottom: 1px dashed rgba(255,255,255,0.03);
            padding-bottom: 2px;
        }
        .band-details div:last-child { border-bottom: none; }
        .band-details span.val { color: #fff; font-weight: 500; }
        
        /* EVIDENZIAMENTO DEL PREZZO DELL'INGAGGIO */
        .band-details div.cost-row {
            background: rgba(255, 42, 42, 0.08);
            border: 1px dashed rgba(255, 42, 42, 0.3);
            padding: 6px 8px;
            border-radius: 6px;
            margin-top: 8px;
            align-items: center;
        }
        .band-details div.cost-row span.cost-label {
            color: #ff9999;
            font-weight: bold;
            text-transform: uppercase;
            font-size: 0.8rem;
        }
        .band-details div.cost-row span.val {
            color: #ff3b3b;
            font-size: 1.15rem;
            font-weight: 800;
            text-shadow: 0 0 6px rgba(255, 42, 42, 0.3);
        }

        .band-card button {
            margin-top: 5px;
            padding: 10px;
            font-size: 0.95rem;
        }

        .action-footer {
            margin-top: 25px;
            display: flex;
            gap: 10px;
        }

        .result-box {
            text-align: center;
            padding: 40px 20px;
            border-radius: 12px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }
        .verdict-LEGGENDARIO { background: linear-gradient(135deg, #4a0000 0%, #ff2a2a 100%); color: #fff; }
        .verdict-NAZIONALE { background: linear-gradient(135deg, #3d2b00 0%, #ffd200 100%); color: #121212; }
        .verdict-MEDIA { background: linear-gradient(135deg, #002b3d 0%, #00bfff 100%); color: #121212; }
        .verdict-LOCAL { background: linear-gradient(135deg, #1c1c24 0%, #2d2d3f 100%); color: #fff; }

        .result-score {
            font-family: 'Arial Black', 'Segoe UI', sans-serif;
            font-size: 5.5rem;
            font-weight: 900;
            line-height: 1;
            margin: 15px 0;
            text-shadow: 3px 3px 0px rgba(0,0,0,0.4);
        }
        .result-badge {
            font-size: 1.4rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }
        .breakdown {
            background: #171724;
            padding: 18px;
            border-radius: 10px;
            margin-bottom: 25px;
            font-size: 0.9rem;
            border: 1px solid #222232;
        }
        .breakdown-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 11px 4px;
            border-bottom: 1px solid #222232;
            gap: 12px;
            flex-wrap: wrap;
        }
        .breakdown-row > span:first-child {
            flex: 1 1 60%;
            min-width: 0;
            word-break: break-word;
        }
        .breakdown-row .val {
            flex: 0 0 auto;
            text-align: right;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            color: #fff;
        }
        .breakdown-row:last-child { border-bottom: none; }

        /* Riepilogo (Dettagli Report d'Impatto) - layout ordinato su mobile.
           Impila etichetta e valore su due righe con il valore allineato a destra,
           evitando sovrapposizioni con testi lunghi. */
        @media (max-width: 600px) {
            .breakdown {
                padding: 14px 12px;
                font-size: 0.88rem;
            }
            .breakdown-row {
                flex-direction: column;
                align-items: stretch;
                gap: 4px;
                padding: 10px 2px;
            }
            .breakdown-row > span:first-child {
                flex: 1 1 auto;
                font-size: 0.85rem;
                color: var(--text-muted);
                letter-spacing: 0.2px;
            }
            .breakdown-row .val {
                align-self: flex-end;
                font-size: 1.02rem;
            }
        }

        /* Frasi del giornale del festival, rivelate una alla volta */
        .journal-sentence {
            font-style: italic;
            color: var(--text-muted);
            line-height: 1.6;
            margin: 0 0 10px 0;
        }
        .journal-sentence:last-child { margin-bottom: 0; }

        footer {
            text-align: center;
            padding: 30px 10px;
            margin-top: 50px;
            border-top: 1px solid #171724;
            font-size: 0.8rem;
            color: #555566;
            line-height: 1.5;
        }
        footer .credits-highlight {
            color: var(--text-muted);
            font-weight: 500;
            margin-top: 4px;
        }

        /* STILI AGGIUNTIVI PER LA CLASSIFICA E IL MODALE */
        .leaderboard-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            font-size: 0.9rem;
        }
        .leaderboard-table th, .leaderboard-table td {
            padding: 10px 12px;
            text-align: left;
            border-bottom: 1px solid #222232;
        }
        .leaderboard-table th {
            color: var(--text-muted);
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.5px;
        }
        .leaderboard-table tbody tr {
            cursor: pointer;
            transition: background 0.2s;
        }
        .leaderboard-table tbody tr:hover {
            background: rgba(255, 255, 255, 0.04);
        }
        .clear-btn {
            width: auto;
            margin-top: 15px;
            padding: 6px 12px;
            font-size: 0.8rem;
            background: #222232;
            border: 1px solid #333344;
            box-shadow: none;
            border-radius: 6px;
            float: right;
        }
        .clear-btn:hover { background: #ff2a2a; border-color: #ff5555; }
        
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(4px);
            align-items: center;
            justify-content: center;
            padding: 15px;
        }
        .modal.active { display: flex; }
        .modal-content {
            background: var(--card-bg);
            border: 1px solid #2d2d3f;
            border-radius: 12px;
            max-width: 500px;
            width: 100%;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.7);
            position: relative;
            animation: fadeIn 0.3s ease;
        }
        .modal-close {
            position: absolute;
            top: 15px; right: 15px;
            font-size: 1.5rem;
            color: var(--text-muted);
            cursor: pointer;
        }
        .modal-close:hover { color: #fff; }
        .modal-band-list {
            list-style: none;
            padding: 0; margin-top: 15px;
        }
        .modal-band-list li {
            padding: 8px;
            background: #171724;
            border-radius: 6px;
            margin-bottom: 6px;
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
        }
		/* Stili aggiuntivi per le nuove funzionalità procedurali e le freccine */
        .mode-selector { margin-bottom: 15px; }
        .mode-tab-btn {
            background: #171724; border: 1px solid #333344; color: var(--text-muted);
            padding: 8px 14px; cursor: pointer; border-radius: 4px; font-weight: bold;
            transition: all 0.2s; margin-right: 5px; margin-bottom: 5px;
        }
        .mode-tab-btn.active {
            background: var(--accent-color); color: #fff; border-color: var(--accent-color);
            box-shadow: 0 0 10px rgba(255, 43, 43, 0.4);
        }
        .procedural-stage {
            background: linear-gradient(180deg, #0d0d14 0%, #1a1a2e 50%, #2a1b2d 100%);
            border: 2px solid var(--accent-color); border-radius: 8px; padding: 15px;
            text-align: center; margin-bottom: 15px; position: relative; overflow: hidden;
            box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
        }
        .stage-lights {
            display: flex; justify-content: space-around; margin-bottom: 10px;
        }
        .light-beam {
            width: 15px; height: 15px; border-radius: 50%;
            background: #ff2b2b; box-shadow: 0 0 15px 5px #ff2b2b;
            animation: pulse-light 1.5s infinite alternate;
        }
        .light-beam:nth-child(2) { background: #00ff7f; box-shadow: 0 0 15px 5px #00ff7f; animation-delay: 0.5s; }
        .light-beam:nth-child(3) { background: #00bfff; box-shadow: 0 0 15px 5px #00bfff; animation-delay: 1s; }
        @keyframes pulse-light { 0% { opacity: 0.4; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); } }
        .stage-equalizer { display: flex; justify-content: center; align-items: flex-end; height: 30px; gap: 4px; margin-top: 10px; }
        .eq-bar { width: 6px; background: var(--accent-color); animation: eq-bounce 0.8s infinite ease-in-out alternate; }
        .eq-bar:nth-child(odd) { background: #ff8c00; animation-duration: 0.5s; }
        @keyframes eq-bounce { 0% { height: 5px; } 100% { height: 28px; } }
        .clickable-band-row {
            background: #171724; border: 1px solid #333344; padding: 10px 14px; border-radius: 6px;
            margin-bottom: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
            transition: transform 0.2s, border-color 0.2s;
        }
        .clickable-band-row:hover { transform: translateX(5px); border-color: var(--accent-color); background: #222232; }
        .badge-bonus { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-left: 5px; }
        .badge-rookie { background: #00ff7f; color: #000; }
        .badge-synergy { background: #00bfff; color: #000; }
        
        /* Centratura riepilogo band */
        #band-detail-modal .modal-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        #band-detail-modal .procedural-stage, #band-detail-modal .breakdown-row {
            width: 100%;
            max-width: 400px;
        }

/* ====================================================
   Stili spostati da index.html (blocchi <style> inline)
   ==================================================== */

/* --- Stili aggiuntivi per funzionalità procedurali --- */
        /* Stili aggiuntivi per le nuove funzionalità procedurali e le freccine */
        .mode-selector { margin-bottom: 15px; }
        .mode-tab-btn {
            background: #171724; border: 1px solid #333344; color: var(--text-muted);
            padding: 8px 14px; cursor: pointer; border-radius: 4px; font-weight: bold;
            transition: all 0.2s; margin-right: 5px; margin-bottom: 5px;
        }
        .mode-tab-btn.active {
            background: var(--accent-color); color: #fff; border-color: var(--accent-color);
            box-shadow: 0 0 10px rgba(255, 43, 43, 0.4);
        }
        .procedural-stage {
            background: linear-gradient(180deg, #0d0d14 0%, #1a1a2e 50%, #2a1b2d 100%);
            border: 2px solid var(--accent-color); border-radius: 8px; padding: 15px;
            text-align: center; margin-bottom: 15px; position: relative; overflow: hidden;
            box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
        }
        .stage-lights {
            display: flex; justify-content: space-around; margin-bottom: 10px;
        }
        .light-beam {
            width: 15px; height: 15px; border-radius: 50%;
            background: #ff2b2b; box-shadow: 0 0 15px 5px #ff2b2b;
            animation: pulse-light 1.5s infinite alternate;
        }
        .light-beam:nth-child(2) { background: #00ff7f; box-shadow: 0 0 15px 5px #00ff7f; animation-delay: 0.5s; }
        .light-beam:nth-child(3) { background: #00bfff; box-shadow: 0 0 15px 5px #00bfff; animation-delay: 1s; }
        @keyframes pulse-light { 0% { opacity: 0.4; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); } }
        .stage-equalizer { display: flex; justify-content: center; align-items: flex-end; height: 30px; gap: 4px; margin-top: 10px; }
        .eq-bar { width: 6px; background: var(--accent-color); animation: eq-bounce 0.8s infinite ease-in-out alternate; }
        .eq-bar:nth-child(odd) { background: #ff8c00; animation-duration: 0.5s; }
        @keyframes eq-bounce { 0% { height: 5px; } 100% { height: 28px; } }

        /* Centratura schermata dettaglio band (Modalità Avanzata) */
        #band-detail-modal { align-items: center; justify-content: center; }
        #band-detail-modal .modal-content { margin: auto; max-width: 600px; width: 92%; max-height: 90vh; overflow-y: auto; }

        .clickable-band-row {
            background: #171724; border: 1px solid #333344; padding: 10px 14px; border-radius: 6px;
            margin-bottom: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
            transition: transform 0.2s, border-color 0.2s;
        }
        .clickable-band-row:hover { transform: translateX(5px); border-color: var(--accent-color); background: #222232; }
        .badge-bonus { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-left: 5px; }
        .badge-bigfour {
            background: linear-gradient(90deg, #ff2b2b, #ff8c00);
            color: #fff;
            border: 1px solid #ffcc00;
            text-shadow: 0 0 4px rgba(0,0,0,0.6);
            box-shadow: 0 0 8px rgba(255,140,0,0.6);
        }
        .badge-rookie { background: #00ff7f; color: #000; }
        .badge-synergy { background: #00bfff; color: #000; }
    
        /* Easter egg punteggio 66: rosso attenuato e glow meno acceso */
        .score-heavy-666 {
            color: #b83232 !important;
            text-shadow: 0 0 6px rgba(184,50,50,0.55), 0 0 14px rgba(139,0,0,0.45);
            animation: heavy-666-pulse 1.6s infinite alternate;
        }
        @keyframes heavy-666-pulse {
            0%   { text-shadow: 0 0 4px rgba(184,50,50,0.45), 0 0 10px rgba(139,0,0,0.35); }
            100% { text-shadow: 0 0 10px rgba(184,50,50,0.6), 0 0 22px rgba(139,0,0,0.5); }
        }
        .heavy-666-tooltip {
            display: inline-block;
            margin-top: 8px;
            padding: 6px 14px;
            background: linear-gradient(90deg, #5a0d0d, #b83232, #5a0d0d);
            color: #f2dcdc;
            font-weight: bold;
            border-radius: 6px;
            box-shadow: 0 0 8px rgba(184,50,50,0.45);
            animation: heavy-666-pulse 1.6s infinite alternate;
            letter-spacing: 1px;
        }

/* --- Protezione contenuti (anti copy / anti inspect) --- */
        /* Disabilita selezione testo e trascinamento immagini */
        html, body {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
        }
        img { -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; -o-user-drag: none; user-drag: none; pointer-events: auto; }
        /* Consente selezione/copia solo dentro campi input/textarea */
        input, textarea, [contenteditable="true"] {
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            user-select: text;
            -webkit-touch-callout: default;
            -webkit-tap-highlight-color: initial;
        }

/* ====================================================
   Centratura definitiva del riepilogo singola band
   (schermata visualizzabile dopo ogni partita)
   ==================================================== */
#band-detail-modal {
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px;
}
#band-detail-modal[style*="display: flex"],
#band-detail-modal[style*="display:flex"],
#band-detail-modal.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#band-detail-modal .modal-content {
    margin: auto !important;
    max-width: 600px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
}
#band-detail-modal .modal-content > * {
    width: 100%;
    max-width: 480px;
}
#band-detail-modal .procedural-stage,
#band-detail-modal .breakdown-row {
    width: 100%;
    max-width: 480px;
}

/* Posizionamento chiusura in alto a destra nel riepilogo singola band */
#band-detail-modal .modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    text-align: right !important;
    z-index: 10 !important;
}

/* ====================================================
   MIGLIORIE UI/UX (accessibilità, feedback, animazioni)
   ==================================================== */

/* Skip link per navigazione da tastiera */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    background: var(--accent-color);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 8px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Testo solo per screen reader */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visibile su tutti gli elementi interattivi */
button:focus-visible,
select:focus-visible,
input:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Modal close come <button> accessibile */
button.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px; height: 36px;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
button.modal-close:hover {
    color: #fff;
    background: rgba(255,42,42,0.15);
    border-color: var(--accent-color);
    box-shadow: none;
    transform: none;
}

/* Rotazione freccia accordion via aria-expanded */
[aria-expanded="true"] .accordion-arrow {
    transform: rotate(180deg);
}
.accordion-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Tab attivi tramite aria-selected */
.mode-tab-btn[aria-selected="true"] {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 43, 43, 0.4);
}

/* Card band non affordabile: opacità ridotta + badge */
.band-card.not-affordable {
    opacity: 0.55;
    filter: grayscale(0.3);
}
.band-card.not-affordable::after {
    /* Badge "Budget Insufficiente" rimosso: l'informazione e' gia'
       presente nel bottone centrale della card. */
    content: none !important;
    display: none !important;
}

/* Reroll disabilitato: tooltip più chiaro */
.reroll-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* HUD responsivo su mobile */
@media (max-width: 480px) {
    .hud {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
        font-size: 0.95rem;
    }
    .hud > div { flex: 1 1 45%; min-width: 130px; }
    .hud > button { flex: 0 0 auto; }
}

/* Reveal procedurale dei risultati (con supporto reduced-motion) */
.reveal-step {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-step.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contenitore del pulsante "Salta animazione": in-flow, allineato a destra.
   Non usa position:fixed cosi' non si sovrappone mai ad altri elementi
   (header, HUD, ecc.), sia su desktop che su mobile. Se il pulsante e'
   nascosto (display:none) il contenitore non occupa spazio extra. */
.skip-reveal-container {
    text-align: right;
}

/* Pulsante "Salta animazione" */
.skip-animation-btn {
    position: static;
    display: inline-block;
    width: auto;
    margin: 0 0 15px 0;
    padding: 8px 14px;
    font-size: 0.85rem;
    background: rgba(19, 19, 26, 0.9);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.skip-animation-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: none;
    box-shadow: 0 4px 12px rgba(255,42,42,0.4);
}

@media (max-width: 480px) {
    .skip-animation-btn {
        width: 100%;
        text-align: center;
    }
}

/* aria-live announcer visivo minimo (opzionale, usato per stato dinamico) */
.live-status {
    background: rgba(255, 42, 42, 0.08);
    border: 1px dashed rgba(255, 42, 42, 0.25);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    min-height: 0;
}
.live-status:empty { display: none; }

/* Rispetto delle preferenze utente per animazioni ridotte */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-step { opacity: 1; transform: none; }
    .light-beam, .eq-bar { animation: none; }
    .score-heavy-666 { animation: none; }
}


/* --- Aggiunte per selezione modalità e hint sui campi obbligatori/facoltativi --- */
.label-hint {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    opacity: 0.8;
    text-transform: uppercase;
    margin-left: 4px;
}

.mode-choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.mode-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 14px 16px;
    width: 100%;
    margin-top: 0;
    background: #171724;
    border: 1px solid #2d2d3f;
    color: var(--text-color);
    border-radius: 8px;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.mode-choice-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent-hover);
    background: #1c1c28;
    box-shadow: none;
}

.mode-choice-btn.is-active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255,42,42,0.14) 0%, rgba(179,0,0,0.10) 100%);
    box-shadow: 0 0 12px rgba(255, 42, 42, 0.25);
}

.mode-choice-title {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.mode-choice-btn.is-active .mode-choice-title {
    color: var(--accent-hover);
}

.mode-choice-desc {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 600px) {
    .mode-choice-group { grid-template-columns: 1fr; }
    .label-hint { font-size: 0.62rem; }
}


/* ====================================================
   FIX (2026-07): visibilità completa modal riepilogo band
   - Consente lo scroll interno quando il contenuto è più alto
     del viewport (nome band lungo + 2 bonus attivi, ecc.)
   - Usa `safe center` così se il contenuto supera il viewport
     resta ancorato in alto e le emoji animate restano visibili.
   ==================================================== */
.modal {
    overflow-y: auto;
    align-items: safe center;
}
#band-detail-modal {
    align-items: safe center !important;
    padding: 20px 15px !important;
}
#band-detail-modal .modal-content {
    max-height: none !important;
    margin: auto !important;
    overflow: visible !important;
}

/* Badge "Budget Insufficiente" rimosso: nessun override mobile necessario. */


/* =========================================================
   🖤 BATTLE OF THE LABELS — stili aggiuntivi
   ========================================================= */

/* Terzo pulsante modalità + icone */
.mode-choice-btn.is-locked {
    opacity: 0.7;
    background: repeating-linear-gradient(45deg, #1a1a26, #1a1a26 10px, #14141c 10px, #14141c 20px);
}
.mode-choice-btn.is-locked .mode-choice-title { color: var(--legendary-color); }
.mode-lock-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85em;
    color: var(--legendary-color);
}
.mode-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    margin-left: 6px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--legendary-color);
    background: transparent;
    color: var(--legendary-color);
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}
.mode-help-btn:hover { background: var(--legendary-color); color: #000; }

/* Sellout meter HUD */
#sellout-meter-container {
    background: var(--card-bg);
    border: 1px solid #222232;
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
}
.sellout-meter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sellout-meter-label span:nth-child(2) {
    color: var(--legendary-color);
    font-weight: bold;
    letter-spacing: 0;
}
.sellout-meter-track {
    position: relative;
    height: 12px;
    background: #0a0a12;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #171724;
}
.sellout-meter-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #00bfff, #ffd200);
    transition: width 0.3s ease;
}
.sellout-meter-marker {
    position: absolute; top: -2px; left: 50%;
    width: 2px; height: 16px;
    background: rgba(255,255,255,0.5);
    transform: translateX(-1px);
}
.sellout-meter-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Modal info sblocchi */
.unlock-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px;
    background: #171724;
    border: 1px solid #222232;
    border-radius: 8px;
}
.unlock-row p { margin: 4px 0 0 0; font-size: 0.85rem; color: var(--text-muted); }
.unlock-status { font-size: 1.4rem; line-height: 1; min-width: 28px; text-align: center; }

/* Label picker */
.label-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.label-card {
    text-align: left;
    background: #171724;
    border: 1px solid #222232;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex; flex-direction: column; gap: 6px;
}
.label-card:hover {
    transform: translateY(-3px);
    border-color: var(--legendary-color);
    box-shadow: 0 6px 20px rgba(255,215,0,0.15);
}
.label-card h4 { margin: 6px 0 0 0; color: #fff; }
.label-card .label-tag {
    margin: 0; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted);
}
.label-card .label-perk { margin: 4px 0 0 0; font-size: 0.85rem; color: var(--tier-c); }
.label-card .label-cons { margin: 4px 0 0 0; font-size: 0.85rem; color: var(--accent-hover); }
.label-card-badge {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}

/* Poster finale */


/* =========================================================
   🖤 BATTLE OF THE LABELS — centratura UI (desktop + mobile)
   ========================================================= */

/* Wrapper del bottone "Battle of the Labels" + pulsante "?" affiancato */
.mode-labels-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.mode-choice-btn.mode-labels {
    width: 100%;
    max-width: calc(50% - 5px);
    align-items: center;
    text-align: center;
    margin: 0;
    position: relative; /* per posizionare il "?" al suo interno */
    padding-right: 44px; /* spazio per il "?" in alto a destra */
    padding-left: 44px;  /* simmetria per titolo centrato */
}
.mode-choice-btn.mode-labels .mode-choice-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}
/* Pulsante "?" ora INTERNO al bottone Battle of the Labels
   Posizionato in alto a destra, cerchio dorato ben visibile */
.mode-help-btn.mode-help-btn-inside {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: 1px solid var(--legendary-color);
    background: rgba(0, 0, 0, 0.35);
    color: var(--legendary-color);
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s, color 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 0 0 rgba(255, 210, 0, 0);
}
.mode-help-btn.mode-help-btn-inside:hover,
.mode-help-btn.mode-help-btn-inside:focus-visible {
    background: var(--legendary-color);
    color: #000;
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(255, 210, 0, 0.55);
    outline: none;
}
@media (max-width: 600px) {
    .mode-labels-wrapper {
        gap: 8px;
    }
    .mode-choice-btn.mode-labels {
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 42px;
        padding-left: 16px; /* su mobile lasciamo il testo più a sinistra */
    }
    .mode-help-btn.mode-help-btn-inside {
        top: 6px;
        right: 6px;
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}

/* =========================================================
   BATTLE OF THE LABELS — centratura schermata "?" e schermata di partita
   Regole scritte in modo forte (con !important dove serve) per superare
   eventuali stili inline presenti in index.html.
   ========================================================= */

/* -------- Modal "?" (Come si sblocca?) — labels-info-modal -------- */
#labels-info-modal { text-align: center !important; }
#labels-info-modal .modal-content {
    text-align: center !important;
    margin: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
}
#labels-info-modal h3,
#labels-info-modal > .modal-content > p {
    text-align: center !important;
    width: 100%;
}
#labels-info-modal #labels-unlock-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}
#labels-info-modal .unlock-row {
    width: 100% !important;
    max-width: 480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: left;
    justify-content: flex-start;
}
#labels-info-modal .unlock-row > div:not(.unlock-status) { flex: 1; }
#labels-info-modal #labels-unlock-status {
    width: 100%;
    max-width: 480px;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* -------- Modal "Firma con un'Etichetta" — label-picker-modal -------- */
#label-picker-modal { text-align: center !important; }
#label-picker-modal .modal-content {
    text-align: center !important;
    margin: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
}
#label-picker-modal h3,
#label-picker-modal > .modal-content > p {
    text-align: center !important;
    width: 100%;
}
#label-picker-modal .label-picker-grid {
    justify-content: center !important;
    justify-items: center !important;
    width: 100%;
    margin: 0 auto !important;
}
#label-picker-modal .label-card {
    width: 100%;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    align-items: center;
}
#label-picker-modal .label-card h4,
#label-picker-modal .label-card p { text-align: center; width: 100%; }
#label-picker-modal .label-card-badge { margin: 0 auto; }

@media (max-width: 600px) {
    #label-picker-modal .label-card { max-width: 100%; }
    #labels-info-modal .unlock-row { max-width: 100%; }
}

/* -------- Schermata di partita in modalità Battle of the Labels -------- */
/* Quando l'etichetta è attiva, la riga HUD "Etichetta:" viene resa visibile
   via JS. Niente più centratura/larghezza forzata: deve comparire in linea
   con le altre voci della HUD (Promoter, Festival, Modalità, Budget,
   Reroll), sia su desktop (griglia) sia su mobile (flex-wrap). Il Sellout
   Meter, invece, resta centrato a parte. */
#hud-label-row {
    font-weight: bold;
    letter-spacing: 0.5px;
}
#sellout-meter-container {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 720px;
    text-align: center;
}
#sellout-meter-container .sellout-meter-label { justify-content: space-between; }
#sellout-meter-container .sellout-meter-hint { text-align: center; }
#sellout-meter-container .sellout-meter-track { margin: 0 auto; }

/* ============================================================
   BATTLE OF THE LABELS — v2 additions
   Cassa dinamica HUD, draft-al-buio (Chaos), badge classifica
   ============================================================ */
#hud-cash-row {
    background: rgba(255, 210, 0, 0.06);
    border-radius: 6px;
    padding: 8px 10px !important;
    font-size: 0.85rem;
    line-height: 1.5;
}
#hud-cash-row #hud-clause-text {
    display: inline-block;
    margin-left: 4px;
}
.band-card.chaos-hidden {
    background: linear-gradient(135deg, #1a0d2e 0%, #13131a 100%);
    border: 2px dashed #7a00ff;
    position: relative;
    overflow: hidden;
}
.band-card.chaos-hidden::before {
    content: "🌀";
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.4rem;
    opacity: 0.5;
}
.band-card.chaos-hidden .band-title,
.band-card.chaos-hidden .band-tier {
    user-select: none;
}
.leaderboard-table td span[title] {
    white-space: nowrap;
}

/* Flash Contract modal accent */
#flash-contract-modal .modal-content {
    animation: flashPulse 0.6s ease-out;
}
@keyframes flashPulse {
    0%   { transform: scale(0.85); opacity: 0; }
    60%  { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); }
}
/* Centra la schermata "Telefonata dall'Etichetta" (Contratto Flash):
   openModal() imposta lo stile inline display:block, quindi qui forziamo
   il flex con !important per centrare il contenuto sia su desktop sia su mobile. */
#flash-contract-modal[style*="display: block"],
#flash-contract-modal[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Condivisione / Salvataggio Immagine Report Festival
   ========================================================================== */
.btn-share-image {
    background: linear-gradient(135deg, #7a00ff 0%, #3d0080 100%);
    box-shadow: 0 4px 12px rgba(122, 0, 255, 0.35);
    margin-top: 14px;
}
.btn-share-image:hover {
    box-shadow: 0 0 15px rgba(122, 0, 255, 0.55);
}

#share-image-modal {
    align-items: center;
}

.share-image-modal-content {
    max-width: 420px;
    width: 100%;
    text-align: center;
    margin: auto;
}

.share-image-preview-wrap {
    max-height: 62vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 14px;
    border: 1px solid #2d2d3f;
    background: #08080b;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

#share-image-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

.share-image-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.share-image-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-action-btn {
    margin-top: 0;
}

.share-action-download {
    background: linear-gradient(135deg, var(--accent-color) 0%, #b30000 100%);
}

.share-action-native {
    background: linear-gradient(135deg, #7a00ff 0%, #3d0080 100%);
    box-shadow: 0 4px 12px rgba(122, 0, 255, 0.35);
}

@media (max-width: 480px) {
    .share-image-modal-content { max-width: 100%; padding: 18px; }
}

/* Discreet game tagline under the title/subtitle */
.game-tagline {
    margin-top: 10px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    opacity: 0.75;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}
@media (max-width: 600px) {
    .game-tagline { font-size: 0.75rem; }
}


/* ==========================================================
   Recap partita (history-modal): sempre centrato sullo schermo
   ========================================================== */
#history-modal {
    align-items: center;
    justify-content: center;
}
#history-modal .modal-content {
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}


/* ==========================================================
   🌍 WORLD TOUR MANAGER — Styles
   ========================================================== */
.mode-special-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}
.mode-special-row .mode-choice-btn.mode-labels {
    flex: 1 1 calc(50% - 5px);
    max-width: calc(50% - 5px);
}
.mode-choice-btn.mode-tour {
    border: 1px solid #2d2d3f;
    background: #171724;
}
.mode-choice-btn.mode-tour.is-locked {
    border: 1px solid #2d2d3f;
    background: repeating-linear-gradient(45deg, #14141c, #14141c 12px, #12121a 12px, #12121a 24px);
}
.mode-choice-btn.mode-tour.is-active {
    border-color: var(--tier-a);
    background: linear-gradient(135deg, rgba(255,210,0,0.14) 0%, rgba(255,106,0,0.10) 100%);
    box-shadow: 0 0 12px rgba(255, 210, 0, 0.28);
}
.mode-choice-btn.mode-tour .mode-choice-title { color: #fff; }
.mode-choice-btn.mode-tour.is-locked .mode-choice-title { color: var(--legendary-color); }
.mode-choice-btn.mode-tour.is-active .mode-choice-title { color: var(--tier-a); }
.mode-choice-btn.mode-tour .mode-help-btn.mode-help-btn-inside {
    border-color: var(--tier-a);
    color: var(--tier-a);
}
.mode-choice-btn.mode-tour .mode-help-btn.mode-help-btn-inside:hover,
.mode-choice-btn.mode-tour .mode-help-btn.mode-help-btn-inside:focus-visible {
    background: var(--tier-a);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 210, 0, 0.55);
}
.mode-tour-icon { margin-left: 6px; font-size: 0.9em; }
@media (max-width: 600px) {
    .mode-special-row .mode-choice-btn.mode-labels {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* Tour info modal */
.tour-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tour-info-block {
    background: #171724;
    border: 1px solid #222232;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.tour-info-block h4 {
    color: var(--tier-a);
    margin: 0 0 6px 0;
    font-size: 0.95rem;
}
.tour-info-nations { grid-column: 1 / -1; }
.tour-good { color: var(--tier-c); }
.tour-bad  { color: var(--accent-hover); }
@media (max-width: 600px) {
    .tour-info-grid { grid-template-columns: 1fr; }
}

/* Nation picker: reuse label-picker-grid look */
.tour-nation-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tour-nation-card:hover { border-color: var(--tier-a); box-shadow: 0 6px 20px rgba(255,210,0,0.18); }

/* Market events */
.tour-market-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tour-market-card {
    background: #171724;
    border: 1px solid #222232;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.tour-market-card:hover:not(.disabled):not(.owned) {
    transform: translateY(-2px);
    border-color: var(--tier-a);
}
.tour-market-card.owned {
    border-color: var(--tier-c);
    background: rgba(0,255,127,0.08);
    cursor: default;
}
.tour-market-card.disabled { opacity: 0.5; cursor: not-allowed; }
.tour-market-card h5 { margin: 0 0 4px 0; color: var(--tier-a); font-size: 0.98rem; }
.tour-market-card p  { margin: 4px 0 0 0; font-size: 0.82rem; color: var(--text-muted); line-height:1.4; }
.tour-market-card .tour-market-cost { color: var(--accent-hover); font-weight: bold; font-size: 0.85rem; }
@media (max-width: 600px) {
    .tour-market-grid { grid-template-columns: 1fr; }
}

/* Tour HUD row */
#hud-tour-row {
    font-weight: bold;
    letter-spacing: 0.5px;
    color: var(--tier-a);
}
#hud-tour-row .hud-tour-nation { color: #fff; }

/* Band card tour badges */
.band-card .tour-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255,210,0,0.15);
    color: var(--tier-a);
    border: 1px solid rgba(255,210,0,0.35);
}
.band-card .tour-badge.tour-badge-warn { background: rgba(255,42,42,0.14); color: var(--accent-hover); border-color: rgba(255,42,42,0.35); }
.band-card .tour-badge.tour-badge-good { background: rgba(0,255,127,0.12); color: var(--tier-c); border-color: rgba(0,255,127,0.35); }

/* Package contract row */
.band-card .package-toggle {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.band-card .package-toggle input { vertical-align: middle; margin-right: 4px; }

/* Tour final summary */
#tour-final-scores .fest-row {
    display: flex; justify-content: space-between;
    padding: 6px 10px; margin: 4px 0;
    background: #171724; border-radius: 6px; border: 1px solid #222232;
    font-size: 0.9rem;
}


/* ==========================================================
   🌍 WORLD TOUR — Completion styles
   ========================================================== */
/* Align labels/tour buttons like Simple/Advanced (left, inside their own card) */
.mode-choice-btn.mode-labels,
.mode-choice-btn.mode-tour {
    align-items: flex-start !important;
    text-align: left !important;
    padding-left: 16px !important;
}
.mode-choice-btn.mode-labels .mode-choice-title,
.mode-choice-btn.mode-tour .mode-choice-title {
    justify-content: flex-start !important;
    text-align: left !important;
}
.mode-choice-btn.mode-labels .mode-choice-desc,
.mode-choice-btn.mode-tour .mode-choice-desc {
    text-align: left !important;
}

/* In-game HUD panel */
.tour-hud-panel {
    margin: 12px 0 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--tier-a);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,210,0,0.08), rgba(255,106,0,0.05));
    color: var(--text-color);
    font-size: 0.9rem;
}
.tour-hud-panel.is-collapsed .tour-hud-body { display: none; }
.tour-hud-panel .tour-hud-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.tour-hud-panel .tour-hud-head h3 { margin: 0; color: var(--tier-a); font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.tour-hud-panel .tour-hud-collapse {
    background: transparent; color: var(--tier-a); border: 1px solid var(--tier-a);
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer; padding: 0;
}
.tour-hud-panel .tour-hud-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; border-bottom: 1px dashed rgba(255,210,0,0.15);
    font-size: 0.85rem;
}
.tour-hud-panel .tour-hud-row:last-of-type { border-bottom: none; }
.tour-hud-panel .tour-hud-row strong { color: #fff; text-align: right; }
.tour-hud-panel .tour-hud-rules {
    margin: 8px 0 0 18px; padding: 0; color: var(--text-muted); font-size: 0.8rem; line-height: 1.5;
}
.tour-hud-panel .tour-good { color: var(--tier-c); }
.tour-hud-panel .tour-bad  { color: var(--accent-hover); }

/* Tour start modal: hide close X, force button-only close */
.tour-start-modal .modal-close { display: none !important; }
.tour-start-modal { backdrop-filter: blur(3px); }
#btn-tour-start-confirm {
    background: linear-gradient(135deg, var(--tier-a), var(--tier-s));
    color: #000; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    border: none; padding: 14px 18px; border-radius: 8px; cursor: pointer;
    font-size: 1rem; box-shadow: 0 0 18px rgba(255,210,0,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
#btn-tour-start-confirm:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(255,210,0,0.55); }

/* Tour lock icon uses same tint as tier-a */
.mode-choice-btn.mode-tour .mode-lock-icon { color: var(--tier-a); margin-left: 6px; }

/* Tour history table zebra */
#tour-history-body tr:nth-child(even) { background: rgba(255,210,0,0.04); }

/* ==========================================================
   Flame Rating (valutazione su 10 fiamme) - schermata risultati
   ========================================================== */
.flame-rating {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin: 18px auto 4px auto;
    padding: 10px 12px;
    max-width: 460px;
    flex-wrap: wrap;
}
.flame-rating .flame {
    width: 26px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: transform 0.35s ease;
}
.flame-rating .flame svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: #3a3a48;
    stroke-width: 1.6;
    stroke-linejoin: round;
    stroke-linecap: round;
    transition: fill 0.5s ease, stroke 0.5s ease, filter 0.5s ease;
    filter: none;
}
.flame-rating .flame.on svg {
    fill: var(--accent-color, #ff2a2a);
    stroke: var(--accent-hover, #ff8a3d);
    filter: drop-shadow(0 0 6px rgba(255, 90, 30, 0.75))
            drop-shadow(0 0 12px rgba(255, 42, 42, 0.45));
    animation: flameIgnite 0.55s ease-out both, flameFlicker 2.2s ease-in-out 0.55s infinite;
}
/* Mezza fiamma (mezzo punto): riempie solo la metà sinistra, la metà destra resta spenta */
.flame-rating .flame.on.half {
    position: relative;
}
.flame-rating .flame.on.half svg {
    fill: none;
    stroke: #3a3a48;
    filter: none;
    animation: none;
}
.flame-rating .flame.on.half::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    /* Overlay SVG acceso ritagliato a metà */
    -webkit-mask: linear-gradient(to right, #000 0 50%, transparent 50% 100%);
            mask: linear-gradient(to right, #000 0 50%, transparent 50% 100%);
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'><path d='M12 1c1.2 4.8 5.6 7.1 6.9 11.5 1.6 5.4-1.6 11-6.9 12.5-5.3-1.5-8.5-7.1-6.9-12.5C6.4 8.1 10.8 5.8 12 1z' fill='%23ff2a2a' stroke='%23ff8a3d' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
    filter: drop-shadow(0 0 6px rgba(255, 90, 30, 0.75))
            drop-shadow(0 0 12px rgba(255, 42, 42, 0.45));
    animation: flameIgnite 0.55s ease-out both, flameFlicker 2.2s ease-in-out 0.55s infinite;
    pointer-events: none;
}
@keyframes flameIgnite {
    0%   { transform: scale(0.6) translateY(6px); opacity: 0.2; }
    60%  { transform: scale(1.15) translateY(-2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes flameFlicker {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 90, 30, 0.75)) drop-shadow(0 0 12px rgba(255, 42, 42, 0.45)); }
    50%      { filter: drop-shadow(0 0 3px rgba(255, 90, 30, 0.55)) drop-shadow(0 0 8px rgba(255, 42, 42, 0.3)); }
}
@media (max-width: 600px) {
    .flame-rating { gap: 5px; max-width: 100%; padding: 8px 4px; }
    .flame-rating .flame { width: 22px; height: 28px; }
}

/* Selettore lingua a pulsanti orizzontali (homepage) */
.lang-btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 42, 42, 0.25);
    box-shadow: var(--shadow-glow);
}
.lang-btn {
    appearance: none;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.lang-btn:hover { color: var(--text-color); background: rgba(255, 42, 42, 0.08); }
.lang-btn.is-active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-hover);
    box-shadow: 0 0 8px rgba(255, 42, 42, 0.6);
}
.lang-btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (max-width: 600px) {
    .lang-btn { padding: 6px 10px; font-size: 0.8rem; }
}

/* Selettore lingua compatto accanto al titolo Impostazioni Festival */
.setup-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.setup-title-row h3 { margin: 0; }
.lang-selector-inline { margin: 0; text-align: right; }
.lang-btn-group--compact {
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    flex-wrap: nowrap;
    background: transparent;
}
.lang-btn-group--compact .lang-btn {
    padding: 3px 6px;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    border-radius: 4px;
    min-width: auto;
    line-height: 1.1;
}
@media (max-width: 600px) {
    .lang-btn-group--compact .lang-btn { padding: 2px 5px; font-size: 0.62rem; }
}


/* Selettore lingua nel header (in alto a destra accanto al titolo) - piccolo ma leggibile */
header {
    position: relative;
    --header-control-top: 14px;
    --header-control-side: 12px;
    --header-control-size: 32px;
}
.lang-selector-header {
    position: absolute;
    top: var(--header-control-top);
    right: var(--header-control-side);
    margin: 0;
    text-align: right;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: var(--header-control-size);
    width: auto;
}
.lang-selector-header .lang-btn-group,
.lang-selector-header .lang-btn-group--compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    margin: 0;
    gap: 0;
    background: rgba(10, 8, 14, 0.88);
    border: 1px solid rgba(255, 42, 42, 0.3);
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.lang-selector-header .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 26px;
    height: 24px;
    margin: 0;
    padding: 0 9px;
    line-height: 1;
    border-radius: 999px;
    position: relative;
}
.lang-selector-header .lang-btn + .lang-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}
.lang-selector-header .lang-btn.is-active::before,
.lang-selector-header .lang-btn.is-active + .lang-btn::before {
    display: none;
}
.lang-selector-header .lang-btn.is-active {
    box-shadow: 0 0 6px rgba(255, 42, 42, 0.6);
}
@media (max-width: 600px) {
    header {
        --header-control-top: 8px;
        --header-control-side: 8px;
        --header-control-size: 32px;
        padding-top: 68px;
    }
    body.lang-selector-hidden header {
        padding-top: 68px;
    }
    .lang-selector-header {
        top: var(--header-control-top);
        right: var(--header-control-side);
        width: auto;
        margin: 0;
        text-align: right;
    }
    .lang-selector-header .lang-btn-group,
    .lang-selector-header .lang-btn-group--compact {
        padding: 2px;
    }
    .lang-selector-header .lang-btn {
        height: 24px;
        min-width: 22px;
        padding: 0 6px;
        margin: 0;
    }
}

/* ============================================================
   SLOT-MACHINE REVEAL (versione GOTHIC/METAL) per il draft
   Attivo all'inizio partita e a ogni Reroll.
   ============================================================ */
.band-card { position: relative; }

.slot-reveal-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    border-radius: inherit;
    overflow: hidden;
    /* Fondo scuro con alone rosso sangue e sigillo pentagramma tenue */
    background:
        radial-gradient(ellipse at 50% 50%, rgba(70, 0, 0, 0.28) 0%, rgba(12, 0, 0, 0.92) 55%, #030305 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23ff2a2a' stroke-width='1.2' opacity='0.12'><circle cx='100' cy='100' r='78'/><polygon points='100,30 41,170 172,80 28,80 159,170'/></g></svg>") center/70% no-repeat,
        var(--card-bg);
    box-shadow:
        inset 0 0 45px rgba(255, 0, 0, 0.22),
        inset 0 0 90px rgba(0, 0, 0, 0.96);
    display: block;
    pointer-events: all;
    cursor: wait;
    /* leggero flicker "candela" durante lo spin */
}
.slot-reveal-overlay.spinning {
    animation: gothicFlicker 1.6s steps(12, end) infinite;
}
@keyframes gothicFlicker {
    0%, 100% { filter: brightness(0.78) contrast(1.05); }
    22%      { filter: brightness(0.6) contrast(1.1); }
    38%      { filter: brightness(0.88) contrast(1.15); }
    54%      { filter: brightness(0.68); }
    70%      { filter: brightness(0.84); }
    86%      { filter: brightness(0.72); }
}

.slot-reveal-overlay::before,
.slot-reveal-overlay::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 40%;
    z-index: 3;
    pointer-events: none;
}
.slot-reveal-overlay::before {
    top: 0;
    background: linear-gradient(180deg, rgba(5,5,7,0.99) 0%, rgba(30,0,0,0.55) 55%, transparent 100%);
    border-bottom: 1px solid rgba(255, 42, 42, 0.45);
    box-shadow: 0 1px 6px rgba(255, 42, 42, 0.35);
}
.slot-reveal-overlay::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(5,5,7,0.99) 0%, rgba(30,0,0,0.55) 55%, transparent 100%);
    border-top: 1px solid rgba(255, 42, 42, 0.45);
    box-shadow: 0 -1px 6px rgba(255, 42, 42, 0.35);
}

/* Cornice-vetrino: due lame rosse orizzontali con glow */
.slot-reveal-overlay .slot-window-frame {
    position: absolute;
    left: 5%; right: 5%;
    top: 50%;
    transform: translateY(-50%);
    height: 48px;
    z-index: 4;
    pointer-events: none;
    border-top: 1px solid rgba(255, 42, 42, 0.75);
    border-bottom: 1px solid rgba(255, 42, 42, 0.75);
    box-shadow:
        0 0 14px rgba(255, 42, 42, 0.55),
        inset 0 0 24px rgba(255, 42, 42, 0.1);
    opacity: 0.7;
    transition: opacity 0.25s ease, box-shadow 0.25s ease;
}
.slot-reveal-overlay.spinning .slot-window-frame { opacity: 0.4; }
.slot-reveal-overlay.clack .slot-window-frame {
    opacity: 1;
    box-shadow:
        0 0 30px var(--accent-color),
        inset 0 0 40px rgba(255, 42, 42, 0.35);
}

.slot-reel {
    position: absolute;
    left: 0; right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform, filter;
    transform: translateY(0);
    /* piu' "gotico": serif scolpito + spaziatura */
    font-family: 'Cinzel', 'Trajan Pro', 'Perpetua Titling MT', 'Georgia', 'Times New Roman', serif;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    z-index: 2;
}

.slot-item {
    height: 48px;
    line-height: 48px;
    padding: 0 14px;
    font-size: 1.05rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    /* horror-poster: aloni cromatici rossi + graffio nero */
    text-shadow:
         1px  0 0 rgba(255, 42, 42, 0.55),
        -1px  0 0 rgba(120, 0, 0, 0.55),
         0 0 8px currentColor,
         0 0 2px rgba(0, 0, 0, 0.95);
}

/* Voci "arcane" / non identificate: sigillo rosso, non blu */
.slot-item.slot-item--unknown {
    color: var(--accent-color) !important;
    letter-spacing: 6px;
    font-family: 'Cinzel', 'Georgia', serif;
    text-shadow:
        0 0 12px rgba(255, 42, 42, 0.9),
        0 0 24px rgba(255, 0, 0, 0.55),
        0 0 2px rgba(0, 0, 0, 0.95);
}

/* Fase clack: impatto forte + tremore + fade-out overlay */
.slot-reveal-overlay.clack {
    animation: slotClackGothic 0.5s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}
@keyframes slotClackGothic {
    0%   { transform: translate(0,0)    scale(1);     filter: brightness(1); }
    8%   { transform: translate(-3px,5px) scale(0.98); filter: brightness(2) saturate(1.4);
           box-shadow: inset 0 0 55px var(--accent-color), 0 0 40px rgba(255, 0, 0, 0.85); }
    22%  { transform: translate(3px,-2px) scale(1.015); filter: brightness(1.35); }
    36%  { transform: translate(-1px,1px) scale(1);    filter: brightness(1.1); }
    70%  { transform: translate(0,0) scale(1); opacity: 0.85; }
    100% { transform: translate(0,0) scale(1); opacity: 0; }
}

/* Ring d'impatto (onda rossa) al momento dell'atterraggio */
.slot-reveal-overlay.clack::before {
    animation: slotShockwave 0.5s ease-out forwards;
}
@keyframes slotShockwave {
    0%   { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.9); }
    100% { box-shadow: 0 0 0 40px rgba(255, 42, 42, 0); }
}

/* Pulse rosso sulla card dopo il clack */
.band-card.slot-landed {
    animation: cardLandedGothic 0.6s ease-out;
}
@keyframes cardLandedGothic {
    0%   { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.75); }
    30%  { box-shadow: 0 0 0 6px rgba(255, 42, 42, 0.22), 0 0 30px rgba(255, 42, 42, 0.6); }
    100% { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0); }
}

@media (max-width: 600px) {
    .slot-item { height: 40px; line-height: 40px; font-size: 0.9rem; letter-spacing: 1.5px; }
    .slot-reveal-overlay .slot-window-frame { height: 40px; }
}

/* ============================================================
   Icone in alto a sinistra (specchio del selettore di lingua)
   ============================================================ */
.icon-actions-header {
    position: absolute;
    top: var(--header-control-top, 14px);
    left: var(--header-control-side, 12px);
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    z-index: 5;
    height: var(--header-control-size, 32px);
    margin: 0;
}
.icon-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--header-control-size, 32px);
    min-width: var(--header-control-size, 32px);
    height: var(--header-control-size, 32px);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 1.5rem; /* dimensione di un'emoji, non più grande */
    cursor: pointer;
    color: inherit;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
    transition: transform 0.15s ease;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}
.icon-emoji-btn:hover,
.icon-emoji-btn:focus-visible {
    transform: scale(1.15);
    outline: none;
    box-shadow: none;
}
@media (max-width: 600px) {
    .icon-actions-header {
        top: var(--header-control-top, 8px);
        left: var(--header-control-side, 8px);
    }
    .icon-emoji-btn { font-size: 1.25rem; }
}

/* Blocchi delle modalità nel modale di aiuto */
.help-mode-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--accent-color);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 0;
}
.help-mode-block h5 {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.help-mode-block p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.5;
}
.help-mode-tag {
    display: inline-block;
    width: 1.4em;
    text-align: center;
    color: var(--tier-c);
    font-weight: bold;
}
.help-mode-tag-lock { color: var(--tier-a); }
.help-mode-locked { border-left-color: var(--tier-a); }
.help-mode-unlock {
    font-size: 0.8rem;
    color: var(--tier-a);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============================================================
   Modali "Introduzione al gioco" e "Record e Storico" centrati
   ============================================================ */
.centered-modal-content {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.centered-modal-content .help-mode-block,
.centered-modal-content .panel {
    text-align: center;
}
.centered-modal-content .help-mode-block h5 {
    justify-content: center;
}
.centered-modal-content .help-mode-block p,
.centered-modal-content > p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 720px;
}
.centered-modal-content .accordion-toggle {
    justify-content: center;
    text-align: center;
}
.centered-modal-content table {
    margin-left: auto;
    margin-right: auto;
}
.centered-modal-content .clear-btn {
    float: none;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   FIX (2026-07): Stack order dei riepiloghi partita
   I riepiloghi aperti da una riga dello "Storico partite precedenti"
   (#history-modal) o del "World Tour Manager" (#tour-final-modal /
   #band-detail-modal) devono comparire SOPRA la finestra elenco
   (#records-modal, #tour-history-modal) sia su desktop sia su mobile.
   ============================================================ */
#records-modal,
#tour-history-modal {
    z-index: 1000;
}

#history-modal,
#tour-final-modal,
#band-detail-modal {
    z-index: 1200 !important;
}


/* Fix overlap "Evento Speciale" nella tabella di riepilogo (modal storico) su mobile */
#hist-modal-event-row {
    display: none; /* controllato via JS che imposta display:flex/block */
}
#hist-modal-event-row[style*="display:none"] { display: none !important; }
/* Quando visibile (lo script rimuove display:none), usa flex */
#history-modal #hist-modal-event-row:not([style*="display:none"]),
#history-modal #hist-modal-event-row:not([style*="display: none"]) {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
#history-modal #hist-modal-event-row > #hist-modal-event {
    float: none !important;
    margin-left: auto;
    text-align: right;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
}
@media (max-width: 600px) {
    #history-modal #hist-modal-event-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    #history-modal #hist-modal-event-row > #hist-modal-event {
        text-align: left;
        margin-left: 0;
        width: 100%;
    }
}


/* ====================================================
   LINE-UP FINALE — leggibilità punteggi (desktop + mobile)
   e centratura metriche "Dettagli Metriche Singola Band" su mobile
   ==================================================== */

.final-lineup-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-color);
}

.final-lineup-list .lineup-band-row,
.final-lineup-list .clickable-band-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #171724;
    border: 1px solid #2a2a3c;
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 0;
}

.final-lineup-list .lineup-band-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.final-lineup-list .lineup-band-name {
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.25;
    word-break: break-word;
}

.final-lineup-list .lineup-band-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.final-lineup-list .lineup-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.final-lineup-list .lineup-badges .badge-bonus { margin-left: 0; }

/* Punteggio: pill ad alto contrasto, cifre tabellari */
.final-lineup-list .lineup-score-box {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 210, 0, 0.1);
    border: 1px solid rgba(255, 210, 0, 0.45);
    border-radius: 999px;
    padding: 6px 14px;
    white-space: nowrap;
}

.final-lineup-list .lineup-score-value {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--tier-a);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(255, 210, 0, 0.35);
}

.final-lineup-list .lineup-score-unit {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--tier-a);
    opacity: 0.85;
}

.final-lineup-list .lineup-score-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}

.final-lineup-list .clickable-band-row:hover {
    transform: translateX(4px);
    border-color: var(--accent-color);
    background: #20202f;
}
.final-lineup-list .clickable-band-row:hover .lineup-score-box {
    background: rgba(255, 210, 0, 0.18);
    border-color: var(--tier-a);
}

@media (max-width: 600px) {
    .final-lineup-list .lineup-band-row,
    .final-lineup-list .clickable-band-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        text-align: center;
    }
    .final-lineup-list .lineup-band-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }
    .final-lineup-list .lineup-band-name { font-size: 1.05rem; }
    .final-lineup-list .lineup-band-meta { white-space: normal; }
    .final-lineup-list .lineup-badges { justify-content: center; }
    .final-lineup-list .lineup-score-box {
        align-self: center;
        width: 100%;
        max-width: 220px;
        justify-content: center;
        padding: 8px 14px;
    }
    .final-lineup-list .lineup-score-value { font-size: 1.65rem; }
    .final-lineup-list .clickable-band-row:hover { transform: none; }
}

/* Dettagli Metriche Singola Band — punteggi centrati su mobile */
@media (max-width: 600px) {
    #band-detail-modal .breakdown-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 4px;
    }
    #band-detail-modal .breakdown-row > span:first-child {
        flex: 1 1 auto;
        width: 100%;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.85rem;
    }
    #band-detail-modal .breakdown-row .val {
        align-self: center;
        width: 100%;
        text-align: center;
        font-size: 1.15rem;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
    }
    #band-detail-modal h4 { text-align: center; width: 100%; }
    #band-detail-modal #bm-bonuses-container { text-align: center; }
}

/* ============================================================
   STAGE VISUALIZER — Mini diorama del palco (schermata risultati)
   ============================================================ */
.stage-visualizer {
    position: relative;
    width: 100%;
    height: 220px;
    margin: 0 0 18px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #05050a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.05);
    isolation: isolate;
    --sv-c1: #ff2a2a;
    --sv-c2: #ffd200;
    --sv-c3: #ffffff;
    --sv-speed: 0.8s;
}
@media (max-width: 600px){
    .stage-visualizer { height: 170px; border-radius: 10px; }
}

/* --- Layer 1 : Cielo dinamico --- */
.stage-visualizer .sv-sky {
    position: absolute; inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, #87ceeb 0%, #ffd280 60%, #ffb56b 100%);
    transition: background 2.5s ease;
}
.stage-visualizer.phase-afternoon .sv-sky {
    background: linear-gradient(180deg, #7bc4f0 0%, #ffdea8 70%, #ffc179 100%);
}
.stage-visualizer.phase-sunset .sv-sky {
    background: linear-gradient(180deg, #2a1550 0%, #a13b7a 40%, #ff7a3d 80%, #ffb547 100%);
}
.stage-visualizer.phase-night .sv-sky {
    background: linear-gradient(180deg, #05050f 0%, #0a0a24 55%, #1a0a2e 100%);
}

/* Sole/Luna */
.stage-visualizer .sv-sun {
    position: absolute; z-index: 2;
    width: 46px; height: 46px; border-radius: 50%;
    left: 50%; top: 12%;
    transform: translate(-50%, 0);
    background: radial-gradient(circle, #fff9d1 0%, #ffd76b 60%, rgba(255,215,107,0) 72%);
    box-shadow: 0 0 40px rgba(255,215,107,0.7);
    transition: top 2.5s ease, background 2s ease, box-shadow 2s ease, opacity 1s ease;
}
.stage-visualizer.phase-afternoon .sv-sun { top: 14%; }
.stage-visualizer.phase-sunset .sv-sun {
    top: 55%;
    background: radial-gradient(circle, #ffe0a0 0%, #ff7a3d 60%, rgba(255,122,61,0) 75%);
    box-shadow: 0 0 60px rgba(255,122,61,0.7);
}
.stage-visualizer.phase-night .sv-sun {
    top: 18%;
    width: 38px; height: 38px;
    background: radial-gradient(circle, #f5f5fa 0%, #cfd0e6 55%, rgba(207,208,230,0) 75%);
    box-shadow: 0 0 35px rgba(220,220,255,0.55);
}

/* Stelle (visibili di notte) */
.stage-visualizer .sv-stars {
    position: absolute; inset: 0; z-index: 2; opacity: 0;
    transition: opacity 1.6s ease;
    background-image:
        radial-gradient(1px 1px at 8% 15%,  #fff, transparent 50%),
        radial-gradient(1px 1px at 22% 30%, #fff, transparent 50%),
        radial-gradient(1px 1px at 35% 10%, #fff, transparent 50%),
        radial-gradient(1px 1px at 48% 22%, #fff, transparent 50%),
        radial-gradient(1px 1px at 62% 8%,  #fff, transparent 50%),
        radial-gradient(1px 1px at 74% 28%, #fff, transparent 50%),
        radial-gradient(1px 1px at 85% 16%, #fff, transparent 50%),
        radial-gradient(1px 1px at 92% 32%, #fff, transparent 50%),
        radial-gradient(1px 1px at 15% 40%, #fff, transparent 50%),
        radial-gradient(1px 1px at 55% 42%, #fff, transparent 50%);
}
.stage-visualizer.phase-night .sv-stars { opacity: 0.85; animation: svTwinkle 3s ease-in-out infinite; }
@keyframes svTwinkle { 0%,100%{opacity:0.85;} 50%{opacity:0.35;} }

/* --- Layer 2 : Truss / palco --- */
.stage-visualizer .sv-truss {
    position: absolute; inset: 0;
    z-index: 4;
    width: 100%; height: 100%;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.7));
}

/* --- Fasci luci (teste mobili) --- */
.stage-visualizer .sv-beams {
    position: absolute; inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.15;
    transition: opacity 1.2s ease;
    mix-blend-mode: screen;
}
.stage-visualizer.sv-lights-low  .sv-beams { opacity: 0.18; }
.stage-visualizer.sv-lights-mid  .sv-beams { opacity: 0.55; }
.stage-visualizer.sv-lights-high .sv-beams { opacity: 0.95; }

.stage-visualizer .sv-beam {
    position: absolute;
    top: 30%;
    width: 8px;
    height: 260px;
    transform-origin: top center;
    filter: blur(3px);
    animation: svBeamSwing var(--sv-speed) ease-in-out infinite alternate;
}
.stage-visualizer .sv-beam-1 { left: 20%;  background: linear-gradient(to bottom, var(--sv-c1) 0%, rgba(255,255,255,0) 90%); animation-delay: 0s;    }
.stage-visualizer .sv-beam-2 { left: 38%;  background: linear-gradient(to bottom, var(--sv-c2) 0%, rgba(255,255,255,0) 90%); animation-delay: -0.3s; }
.stage-visualizer .sv-beam-3 { left: 56%;  background: linear-gradient(to bottom, var(--sv-c3) 0%, rgba(255,255,255,0) 90%); animation-delay: -0.6s; }
.stage-visualizer .sv-beam-4 { left: 74%;  background: linear-gradient(to bottom, var(--sv-c1) 0%, rgba(255,255,255,0) 90%); animation-delay: -0.9s; }

@keyframes svBeamSwing {
    0%   { transform: rotate(-35deg); opacity: 0.55; }
    50%  { transform: rotate(0deg);   opacity: 1;    }
    100% { transform: rotate(35deg);  opacity: 0.55; }
}

/* Strobo */
.stage-visualizer .sv-strobe {
    position: absolute; inset: 0;
    z-index: 6;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}
.stage-visualizer.sv-strobe-on.sv-lights-high .sv-strobe {
    animation: svStrobe 0.28s steps(2, jump-none) infinite;
}
@keyframes svStrobe { 0%,45%{opacity:0;} 50%{opacity:0.55;} 55%,100%{opacity:0;} }

/* --- Layer 3 : Folla / silhouette --- */
.stage-visualizer .sv-crowd {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 7;
    width: 100%; height: 55%;
    filter: drop-shadow(0 -4px 10px rgba(0,0,0,0.6));
}

/* Mani alzate 🤘 in silhouette (moshpit) */
.stage-visualizer .sv-hands {
    position: absolute;
    left: 0; right: 0; bottom: 26%;
    z-index: 8;
    height: 40px;
    pointer-events: none;
}
.stage-visualizer .sv-hand {
    position: absolute;
    bottom: 0;
    font-size: 16px;
    color: #000;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.9);
    filter: brightness(0);
    opacity: 0.9;
    transform-origin: bottom center;
    animation: svHandPump 0.9s ease-in-out infinite;
}
.stage-visualizer .sv-hand:nth-child(2n) { animation-duration: 1.1s; animation-delay: -0.2s; }
.stage-visualizer .sv-hand:nth-child(3n) { animation-duration: 0.75s; animation-delay: -0.35s; }
.stage-visualizer .sv-hand:nth-child(5n) { animation-duration: 1.25s; animation-delay: -0.5s; }
@keyframes svHandPump {
    0%,100% { transform: translateY(0) rotate(-4deg);   }
    50%     { transform: translateY(-14px) rotate(4deg);}
}

/* Densità folla (mani) in base alla fase */
.stage-visualizer.phase-afternoon .sv-hand { opacity: 0.35; animation-duration: 1.6s; }
.stage-visualizer.phase-afternoon .sv-hand:nth-child(2n+1) { display: none; }
.stage-visualizer.phase-sunset .sv-hand { opacity: 0.7; }
.stage-visualizer.phase-night .sv-hand { opacity: 1; }
.stage-visualizer.phase-night.sv-lights-high .sv-hand {
    animation-duration: 0.6s;
}

/* Pirotecnica (headliner Tier S) */
.stage-visualizer .sv-pyro {
    position: absolute;
    bottom: 45%;
    width: 4px; height: 4px;
    z-index: 5;
    opacity: 0;
    background: radial-gradient(circle, #fff8c4 0%, #ffb347 40%, rgba(255,42,42,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1px);
}
.stage-visualizer .sv-pyro-l { left: 18%; }
.stage-visualizer .sv-pyro-r { right: 18%; }
.stage-visualizer.sv-pyro-on .sv-pyro {
    animation: svPyro 1.6s ease-out infinite;
}
.stage-visualizer.sv-pyro-on .sv-pyro-r { animation-delay: -0.8s; }
@keyframes svPyro {
    0%   { opacity: 0; transform: scale(0.4) translateY(0);   box-shadow: 0 0 0 rgba(255,180,71,0); }
    10%  { opacity: 1; transform: scale(1)   translateY(-6px);box-shadow: 0 0 60px 20px rgba(255,180,71,0.9); }
    45%  { opacity: 0.8; transform: scale(2.2) translateY(-40px);box-shadow: 0 0 40px 10px rgba(255,120,50,0.5); }
    100% { opacity: 0; transform: scale(3.5) translateY(-90px); box-shadow: 0 0 0 rgba(255,120,50,0); }
}

/* HUD: orario + band corrente */
.stage-visualizer .sv-hud {
    position: absolute;
    left: 10px; bottom: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    font-size: 0.78rem;
    color: #f5f5fa;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    max-width: calc(100% - 90px);
    line-height: 1.25;
}
.stage-visualizer .sv-hud-time  { color: var(--tier-a); font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.stage-visualizer .sv-hud-sep   { color: var(--text-muted); }
.stage-visualizer .sv-hud-band  { font-weight: 700; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.stage-visualizer .sv-hud-genre { color: var(--text-muted); font-size: 0.72rem; overflow-wrap: anywhere; }

/* Indicatore LIVE */
.stage-visualizer .sv-liveblink {
    position: absolute;
    right: 10px; top: 8px;
    z-index: 10;
    padding: 3px 8px;
    background: rgba(255,42,42,0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 1px;
    border-radius: 4px;
    animation: svLive 1s ease-in-out infinite;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
@keyframes svLive { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

@media (max-width: 600px){
    .stage-visualizer .sv-hud {
        font-size: 0.68rem;
        padding: 4px 8px;
        max-width: calc(100% - 78px);
        border-radius: 12px;
        gap: 2px 6px;
    }
    .stage-visualizer .sv-hud-sep { display: none; }
    .stage-visualizer .sv-hud-band { flex: 1 1 100%; }
    .stage-visualizer .sv-hud-genre { flex: 1 1 100%; font-size: 0.62rem; }
    .stage-visualizer .sv-liveblink { font-size: 0.62rem; padding: 2px 6px; }
    .stage-visualizer .sv-beam { height: 200px; width: 6px; }
    .stage-visualizer .sv-hand { font-size: 13px; }
}


/* ============================================================
   IMPOSTAZIONI DI GIOCO (modale ⚙️) — stile coerente col tema metal
   ============================================================ */
.settings-modal-content {
    max-width: 760px;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    text-align: left;
    padding: 20px 22px;
}
.settings-title {
    color: var(--accent-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.settings-intro {
    color: var(--text-muted);
    font-size: 0.86rem;
    text-align: center;
    margin-bottom: 12px;
}
.settings-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    padding: 11px 14px;
    margin: 8px 0;
}
.settings-section:first-of-type { margin-top: 0; }
.settings-section:last-of-type { margin-bottom: 0; }
.settings-section--danger {
    border-left-color: #8b0000;
    background: rgba(139, 0, 0, 0.08);
    border-color: rgba(255, 42, 42, 0.25);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.settings-row--stack {
    align-items: stretch;
    flex-direction: column;
}
.settings-row.settings-row--stack > .settings-row-text,
.settings-row.settings-row--stack > * { flex: 0 0 auto; width: 100%; }
.settings-row-text { flex: 1 1 260px; min-width: 200px; }
.settings-row-text h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--tier-a);
    margin-bottom: 2px;
}
.settings-row-text p {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin: 0;
}

/* Interruttore SI/NO — il contenitore è solo un layout invisibile:
   ogni bottone porta da sé tutto lo stile (bordo/sfondo), esattamente
   come un pulsante normale del sito. */
.settings-switch {
    display: inline-flex;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.settings-switch-btn {
    appearance: none;
    background: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid rgba(255, 42, 42, 0.25);
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
}
.settings-switch-btn:hover { color: var(--text-color); background: rgba(255, 42, 42, 0.1); border-color: var(--accent-hover); }
.settings-switch-btn.is-active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-hover);
    box-shadow: 0 0 8px rgba(255, 42, 42, 0.6);
}
.settings-switch-btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

/* Blocco installazione app */
.settings-install-box {
    width: 100%;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
}
.settings-device-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--tier-b);
    margin: 0 0 4px 0;
}
.settings-install-steps {
    font-size: 0.88rem;
    color: var(--text-color);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* Pulsanti azione */
.settings-action-btn {
    appearance: none;
    background: var(--accent-color);
    color: #fff;
    border: 1px solid var(--accent-hover);
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    width: auto;
}
.settings-action-btn:hover { background: var(--accent-hover); }
.settings-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.settings-action-btn--danger {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid rgba(255, 42, 42, 0.6);
}
.settings-action-btn--danger:hover { background: rgba(255, 42, 42, 0.15); color: #fff; }
.settings-action-btn--danger.is-armed {
    background: #8b0000;
    color: #fff;
    border-color: #ff2a2a;
    box-shadow: 0 0 12px rgba(255, 42, 42, 0.55);
}
.settings-danger-box { width: 100%; margin-top: 8px; }
.settings-danger-msg {
    display: none;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffb3b3;
    line-height: 1.4;
}
.settings-danger-msg.is-visible { display: block; }

@media (max-width: 600px) {
    .settings-modal-content { max-height: calc(100vh - 16px); padding: 14px 14px; }
    .settings-title { margin-bottom: 3px; }
    .settings-intro { margin-bottom: 10px; }
    .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .settings-row-text { flex: 0 0 auto; width: 100%; min-width: 0; }
    .settings-switch { width: 100%; justify-content: center; }
    .settings-switch-btn { flex: 1; }
    .settings-action-btn { width: 100%; }
    .settings-section { padding: 10px 12px; margin: 6px 0; }
    .settings-install-box, .settings-danger-box { margin-top: 6px; }
}

/* Icone header disattivate durante la partita */
.icon-emoji-btn:disabled,
.icon-emoji-btn.is-disabled {
    opacity: 0.28;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1) drop-shadow(0 0 4px rgba(0,0,0,0.6));
    transform: none;
}

/* ============================================================
   ANIMAZIONI DISATTIVATE dalle impostazioni di gioco
   (palco di fine partita, roll/reroll del draft e tutto il resto)
   ============================================================ */
html.anims-off *,
html.anims-off *::before,
html.anims-off *::after,
body.anims-off *,
body.anims-off *::before,
body.anims-off *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
body.anims-off .reveal-step { opacity: 1 !important; transform: none !important; }
body.anims-off .light-beam,
body.anims-off .eq-bar,
body.anims-off .score-heavy-666,
body.anims-off .sv-stars,
body.anims-off .sv-beam,
body.anims-off .sv-strobe,
body.anims-off .sv-hand,
body.anims-off .sv-pyro,
body.anims-off .sv-live,
body.anims-off .flame,
body.anims-off .slot-reveal-overlay { animation: none !important; }
body.anims-off .sv-strobe { opacity: 0 !important; }
body.anims-off .slot-reveal-overlay { display: none !important; }

/* ============================================================
   HOMEPAGE (schermata Impostazioni Festival) — layout DESKTOP
   più stretto. Attivo solo da 601px in su, per non toccare la
   versione mobile (che resta invariata).
   ============================================================ */
@media (min-width: 601px) {

    :root {
        /* Larghezza della colonna "stretta" condivisa dai due pannelli
           della homepage: cambiando solo questo valore si aggiorna
           automaticamente anche la posizione delle icone in alto. */
        --setup-narrow-width: 480px;
    }

    /* Il pannello "Regolamento e Guida Strategica" eredita la stessa
       larghezza del pannello impostazioni semplicemente perché
       #screen-setup (il loro contenitore comune) viene ristretto qui. */
    #screen-setup {
        max-width: var(--setup-narrow-width);
        margin-left: auto;
        margin-right: auto;
    }

    /* Adattamento del contenuto del pannello impostazioni alla larghezza ridotta */
    .panel-festival-settings h3 {
        font-size: 1.25rem;
    }

    /* Bottoni modalità: uno sotto l'altro invece che affiancati a coppie */
    .panel-festival-settings .mode-choice-group {
        grid-template-columns: 1fr;
    }
    .panel-festival-settings .mode-special-row .mode-choice-btn.mode-labels {
        max-width: 100%;
        flex: 1 1 100%;
    }

    /* Icone in alto (impostazioni/aiuto/record) e selettore lingua:
       seguono i bordi della colonna più stretta invece dei bordi
       dell'intero container. Si applica solo mentre la schermata
       Home/Setup è quella attiva, lasciando invariata la posizione
       nelle altre schermate (gioco, risultati). */
    body:has(#screen-setup.active) .icon-actions-header {
        left: calc(50% - (var(--setup-narrow-width) / 2) + var(--header-control-side));
    }
    body:has(#screen-setup.active) .lang-selector-header {
        right: calc(50% - (var(--setup-narrow-width) / 2) + var(--header-control-side));
    }
}

/* ============================================================
   POP-UP DI BENVENUTO (mostrato alla prima apertura del gioco)
   ============================================================ */
.welcome-modal-content {
    max-width: 460px;
    text-align: center;
}
.welcome-modal-title {
    color: var(--accent-color);
    margin-bottom: 14px;
}
.welcome-modal-text {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 12px;
    text-align: left;
}
.welcome-modal-hint {
    color: var(--text-muted);
    font-size: 0.88rem;
}
.welcome-modal-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.92rem;
    line-height: 1.2;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.welcome-modal-checkbox-row input[type="checkbox"] {
    -webkit-appearance: checkbox;
    appearance: auto;
    flex: 0 0 auto;
    width: 20px;
    min-width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: none;
    accent-color: var(--accent-color);
    cursor: pointer;
    vertical-align: middle;
    transform: translateY(0);
}
.welcome-modal-checkbox-row span {
    display: inline-block;
    max-width: 100%;
    line-height: 20px;
    text-align: center;
}
@media (max-width: 600px) {
    .welcome-modal-checkbox-row {
        gap: 10px;
        font-size: 0.9rem;
    }
    .welcome-modal-checkbox-row input[type="checkbox"] {
        width: 22px;
        min-width: 22px;
        height: 22px;
    }
    .welcome-modal-checkbox-row span {
        line-height: 22px;
        text-align: center;
    }
}
