: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: 35px 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: 'Impact', 'Arial Black', sans-serif;
            font-size: 3.5rem;
            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) {
            h1 { font-size: 2.2rem; 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: 'Impact', 'Arial Black', 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;
            padding: 11px 4px;
            border-bottom: 1px solid #222232;
            gap: 12px;
        }
        .breakdown-row:last-child { border-bottom: none; }

        /* 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; }
    
        .score-heavy-666 {
            color: #ff2b2b !important;
            text-shadow: 0 0 12px #ff2b2b, 0 0 24px #ff0000, 0 0 40px #8b0000;
            animation: heavy-666-pulse 1.2s infinite alternate;
        }
        @keyframes heavy-666-pulse {
            0% { text-shadow: 0 0 8px #ff2b2b, 0 0 16px #ff0000; }
            100% { text-shadow: 0 0 20px #ff6600, 0 0 36px #ff2b2b, 0 0 56px #8b0000; }
        }
        .heavy-666-tooltip {
            display: inline-block;
            margin-top: 8px;
            padding: 6px 14px;
            background: linear-gradient(90deg, #8b0000, #ff2b2b, #8b0000);
            color: #fff;
            font-weight: bold;
            border-radius: 6px;
            box-shadow: 0 0 15px rgba(255,43,43,0.7);
            animation: heavy-666-pulse 1.2s 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 {
    content: attr(data-unaffordable-label);
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 42, 42, 0.15);
    color: #ff8a8a;
    border: 1px solid rgba(255, 42, 42, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* 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; }
}
