@font-face {
            font-family: 'alte_haas_groteskbold';
            src: url('https://cdn.nsqkk.com/fonts/AlteHaasGroteskBold.woff2') format('woff2'),
                 url('https://cdn.nsqkk.com/fonts/AlteHaasGroteskBold.woff') format('woff');
            font-display: block;
        }

        :root {
            --primary-color: #011EF6;
            --white: #ffffff;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            background-color: black;
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 100dvh;
            overflow-x: hidden;
            padding-bottom: 110px;
            color: white;
            font-family: Arial, sans-serif;
        }

        .poster-container {
            position: fixed;
            bottom: 0; left: 0;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: flex-end;
            z-index: 0;
        }
        .poster-image {
            max-width: 100%;
            max-height: 90vh;
            height: auto;
            display: block;
            object-fit: contain;
        }
        @media (max-width: 768px) {
            .poster-image {
                width: 100%;
                height: 45vh;
                object-fit: cover;
                object-position: center;
            }
        }

        .click-hint {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: clamp(11px, 1.4vw, 14px);
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.6);
            text-align: center;
            margin-bottom: 14px;
            animation: hint-pulse 2.2s ease-in-out infinite;
            pointer-events: none;
            transition: opacity 0.4s ease;
        }
        .click-hint.hidden { opacity: 0; }
        @keyframes hint-pulse {
            0%, 100% { opacity: 0.5; transform: translateY(0); }
            50%       { opacity: 1;   transform: translateY(-4px); }
        }

        .ticket-clip {
            overflow: hidden;
            display: inline-block;
        }

        .ticket-wrapper {
            position: relative;
            z-index: 100;
            display: inline-block;
            cursor: pointer;
            max-width: min(90vw, 1050px);
            max-height: 70dvh;
        }

        .ticket-img {
            display: block;
            max-width: min(90vw, 1050px);
            max-height: 70dvh;
            width: auto;
            height: auto;
            pointer-events: none;
        }

        .rotated-field {
            position: absolute;
            display: block;
            height: 10px;
        }

        .rotated-field .input-wrap {
            position: absolute;
            top: 0;
            left: 0;
            width: 300px;
            transform: rotate(90deg);
            transform-origin: top left;
            display: flex;
            flex-direction: row;
            gap: 8px;
        }

        .tick-label {
            font-family: 'Special Elite', cursive;
            font-size: var(--tick-label-size, 11px);
            color: #b00;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            white-space: nowrap;
            pointer-events: none;
            transition: color 0.3s ease;
            flex-shrink: 0;
        }
        .rotated-field.filled .tick-label { color: rgba(0,0,0,0.85); }

        .input-field-wrap {
            position: relative;
            flex: 1;
            min-width: 0;
        }

        .tick-input {
            font-family: 'Special Elite', cursive;
            font-size: var(--tick-input-size, 16px);
            color: #111;
            background: transparent;
            border: none;
            outline: none;
            border-bottom: 1px solid rgba(0,0,0,0.2);
            padding: 1px 0;
            width: 100%;
            min-width: 0;
            caret-color: #111;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
        }
        .tick-input[readonly] { cursor: pointer; border-bottom-color: transparent; }
        .tick-input::placeholder { color: #b00; transition: color 0.3s ease; }
        .rotated-field.filled .tick-input::placeholder { color: rgba(0,0,0,0.35); }
        .ticket-wrapper.is-editing .tick-input:not([readonly]) { border-bottom-color: rgba(0,0,0,0.2); }

        .tick-overlay {
            position: absolute;
            top: 0; left: 0;
            font-family: 'Special Elite', cursive;
            font-size: var(--tick-input-size, 16px);
            color: #111;
            white-space: nowrap;
            line-height: 1;
            padding: 1px 0;
            display: none;
            pointer-events: none;
            background: transparent;
        }

        .suggestions-dropdown {
            position: fixed;
            width: min(220px, 55vw);
            background: rgba(255, 255, 255, 0.98);
            border-radius: 8px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.15);
            max-height: 150px;
            overflow-y: auto;
            z-index: 200;
            display: none;
            flex-direction: column;
            direction: ltr;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }
        .suggestions-dropdown::-webkit-scrollbar { width: 6px; }
        .suggestions-dropdown::-webkit-scrollbar-thumb {
            background: rgba(1, 30, 246, 0.3);
            border-radius: 4px;
        }
        .suggestion-item {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: clamp(10px, 1.2vw, 14px);
            color: #1a1a2e;
            padding: 8px 12px;
            cursor: pointer;
            border-bottom: 1px solid rgba(0,0,0,0.05);
            text-align: left;
            transition: background 0.2s ease, color 0.2s ease;
        }
        .suggestion-item:last-child { border-bottom: none; }
        .suggestion-item:hover {
            background: rgba(1, 30, 246, 0.1);
            color: var(--primary-color);
        }

        .circulo-overlay {
            position: absolute;
            display: none;
            pointer-events: none;
            z-index: 50;
            width: 32%;
        }
        #circuloMosca  { top: -3%;  left: 13%;  }
        #circuloNsqk { top: -3%;  left: 52%; }

        .lg {
            background: rgba(255,255,255,0.13);
            backdrop-filter: blur(28px) saturate(180%);
            -webkit-backdrop-filter: blur(28px) saturate(180%);
            border: 1px solid rgba(255,255,255,0.28);
            box-shadow:
                0 8px 32px rgba(0,0,0,0.35),
                inset 0 1.5px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(255,255,255,0.06);
        }

        .below-ticket {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            position: relative;
            z-index: 150;
        }

        .model-switcher {
            display: none;
            align-items: center;
            gap: 6px;
            background: rgba(255,255,255,0.13);
            backdrop-filter: blur(28px) saturate(180%);
            -webkit-backdrop-filter: blur(28px) saturate(180%);
            border: 1px solid rgba(255,255,255,0.28);
            box-shadow:
                0 8px 32px rgba(0,0,0,0.35),
                inset 0 1.5px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(255,255,255,0.06);
            border-radius: 20px;
            padding: 6px 16px;
            margin-top: 12px;
        }

        .model-switcher-label {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: clamp(9px, 1vw, 11px);
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.55);
            margin-right: 4px;
            white-space: nowrap;
        }

        .model-dot {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 1px solid rgba(255,255,255,0.35);
            background: rgba(255,255,255,0.1);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
            cursor: pointer;
            padding: 0;
            transition: all 0.2s ease;
            flex-shrink: 0;
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 13px;
            color: rgba(255,255,255,0.8);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .model-dot.active {
            background: rgba(255,255,255,0.9);
            border-color: rgba(255,255,255,0.9);
            color: #000;
            box-shadow: 0 2px 8px rgba(255,255,255,0.25), inset 0 1px 0 rgba(255,255,255,1);
        }
        .model-dot:hover:not(.active) { background: rgba(255,255,255,0.2); }

        .below-ticket .custom-control {
            background: rgba(255,255,255,0.13);
            backdrop-filter: blur(28px) saturate(180%);
            -webkit-backdrop-filter: blur(28px) saturate(180%);
            border: 1px solid rgba(255,255,255,0.28);
            box-shadow:
                0 8px 32px rgba(0,0,0,0.35),
                inset 0 1.5px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.9);
        }
        .below-ticket .custom-control:hover {
            background: rgba(255,255,255,0.25);
            border-color: rgba(255,255,255,0.5);
            color: #fff;
            box-shadow:
                0 8px 32px rgba(0,0,0,0.4),
                inset 0 1.5px 0 rgba(255,255,255,0.5);
        }

        .ganador-wrapper { position: relative; }

        .ganador-popup {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: rgba(20,20,28,0.72);
            backdrop-filter: blur(28px) saturate(180%);
            -webkit-backdrop-filter: blur(28px) saturate(180%);
            border: 1px solid rgba(255,255,255,0.18);
            box-shadow:
                0 16px 40px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.2);
            border-radius: 16px;
            padding: 6px;
            display: none;
            flex-direction: column;
            gap: 4px;
            z-index: 300;
            min-width: 130px;
        }
        .ganador-popup.active { display: flex; }

        .ganador-opt {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 12px;
            padding: 8px 14px;
            border: none;
            border-radius: 10px;
            background: transparent;
            cursor: pointer;
            text-transform: uppercase;
            color: rgba(255,255,255,0.85);
            transition: background 0.15s ease, color 0.15s ease;
            text-align: center;
            letter-spacing: 0.3px;
            white-space: nowrap;
        }
        .ganador-opt:hover, .ganador-opt.selected {
            background: rgba(255,255,255,0.18);
            color: #fff;
        }

        .field-nombre { top: 5%;  left: 87.3%; width: 42%; }
        .field-lugar  { top: 5%;  left: 82.6%; width: 38%; }

        .sig-area {
            position: absolute;
            bottom: 14%;
            left: 21%;
            width: 36%;
            height: 13%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .ticket-wrapper.is-editing .sig-area {
            border-bottom: 1px dashed rgba(0,0,0,0.25);
            cursor: crosshair;
        }

        #sigDefault {
            font-family: 'Special Elite', cursive;
            font-size: clamp(11px, 1.6vw, 18px);
            color: rgba(0,0,0,0.7);
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        #sigCanvas {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        .ticket-wrapper.is-editing #sigCanvas {
            opacity: 1;
            visibility: visible;
        }

        .btn-radio-footer {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            background: rgba(255,255,255,0.12);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border: 1px solid rgba(255,255,255,0.28);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
            padding: 4px 12px;
            border-radius: 20px;
            text-decoration: none;
            color: rgba(255,255,255,0.9);
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 11px;
            letter-spacing: 0.5px;
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .btn-radio-footer:hover {
            background: rgba(255,255,255,0.25);
            border-color: rgba(255,255,255,0.5);
            color: #fff;
            transform: scale(1.05);
        }

        .bottom-bar {
            position: fixed;
            bottom: 25px;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 1000px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            z-index: 200;
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(32px) saturate(200%);
            -webkit-backdrop-filter: blur(32px) saturate(200%);
            border: 1px solid rgba(255,255,255,0.25);
            box-shadow:
                0 20px 60px rgba(0,0,0,0.45),
                inset 0 1.5px 0 rgba(255,255,255,0.4),
                inset 0 -1px 0 rgba(255,255,255,0.06);
            border-radius: 28px;
            gap: 15px;
        }

        .loguito-footer {
            height: 40px;
            width: auto;
            cursor: pointer;
            transition: transform 0.2s ease;
            display: block;
            flex-shrink: 0;
        }
        .loguito-footer:hover { transform: scale(1.05); }

        .controls-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            flex: 1;
        }

        .custom-control {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 1rem;
            height: 48px;
            padding: 0 30px;
            border: 1px solid rgba(255,255,255,0.28);
            border-radius: 14px;
            background: rgba(255,255,255,0.12);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            box-shadow:
                0 4px 16px rgba(0,0,0,0.25),
                inset 0 1.5px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.9);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            outline: none;
            min-width: 140px;
        }
        .custom-control:hover {
            background: rgba(255,255,255,0.22);
            border-color: rgba(255,255,255,0.5);
            color: #fff;
            box-shadow:
                0 8px 24px rgba(0,0,0,0.3),
                inset 0 1.5px 0 rgba(255,255,255,0.5);
        }
        .custom-control:disabled {
            border-color: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.04);
            box-shadow: none;
            cursor: not-allowed;
            opacity: 1;
        }
        .custom-control:disabled:hover {
            background: rgba(255,255,255,0.04);
            border-color: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.2);
            box-shadow: none;
        }

        .dl-spinner {
            display: inline-block;
            width: 18px;
            height: 18px;
            border: 2.5px solid rgba(255,255,255,0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            margin-right: 8px;
            vertical-align: middle;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        .dl-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.65);
            z-index: 9000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }
        .dl-modal-overlay.open { opacity: 1; visibility: visible; }

        .dl-modal {
            background: #111;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 20px;
            padding: 32px 28px 24px;
            max-width: 340px;
            width: 90vw;
            text-align: center;
            box-shadow: 0 24px 60px rgba(0,0,0,0.6);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            transform: translateY(12px);
            transition: transform 0.3s ease;
        }
        .dl-modal-overlay.open .dl-modal { transform: translateY(0); }

        .dl-modal-icon { width: 44px; height: 44px; color: rgba(255,255,255,0.75); }

        .dl-modal-title {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 15px;
            color: #fff;
            line-height: 1.4;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .dl-modal-sub {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 10px;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.35);
            line-height: 1.6;
        }

        .dl-modal-actions { display: flex; gap: 8px; width: 100%; margin-top: 4px; }

        .dl-modal-btn-map {
            flex: 1;
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 12px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            padding: 12px 0;
            border-radius: 12px;
            border: none;
            background: #fff;
            color: #000;
            cursor: pointer;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.2s ease;
        }
        .dl-modal-btn-map:hover { opacity: 0.85; }

        .dl-modal-btn-close {
            font-family: 'alte_haas_groteskbold', sans-serif;
            font-size: 12px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            padding: 12px 16px;
            border-radius: 12px;
            border: 1.5px solid rgba(255,255,255,0.2);
            background: transparent;
            color: rgba(255,255,255,0.4);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .dl-modal-btn-close:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

        @media (max-width: 991px) {
            .bottom-bar {
                bottom: 15px;
                width: 95%;
                padding: 0.5rem 0.75rem;
                border-radius: 18px;
                background: rgba(255,255,255,0.1);
                gap: 8px;
            }
            .controls-wrapper { flex: 1; width: auto; flex-direction: row !important; gap: 6px; flex-wrap: wrap; }
            .custom-control { font-size: 0.75rem; height: 36px; padding: 0 10px; flex: 1; min-width: unset; }
            .loguito-footer { height: 24px; width: auto; }
            #nsqkChartsX .loguito-footer { display: block !important; }
        }
        @media (max-width: 400px) {
            .bottom-bar { gap: 6px; padding: 0.4rem 0.5rem; }
            .loguito-footer { height: 20px; }
            .custom-control { font-size: 0.7rem; height: 32px; }
        }

        /* Viewports cortos (laptop 14") */
        @media (max-height: 900px) {
            body {
                padding-bottom: 170px;
                overflow-y: auto;
                overflow-x: hidden;
            }
            .ticket-wrapper {
                max-height: 52dvh;
            }
            .ticket-img {
                max-height: 52dvh;
            }
        }