    :root {
      --bg-color: #0f172a;
      --card-bg: #1e293b;
      --accent-color: #3b82f6;
      --accent-hover: #2563eb;
      --danger-color: #ef4444;
      --success-color: #22c55e;
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --border-color: #334155;
    }

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

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      background-color: var(--bg-color);
      color: var(--text-main);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      padding: 20px;
      line-height: 1.5;
    }

    .container {
      width: 100%;
      max-width: 440px;
      background: var(--card-bg);
      border-radius: 20px;
      padding: 24px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
      border: 1px solid var(--border-color);
      text-align: center;
    }

    .app-title {
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 6px;
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .app-subtitle {
      font-size: 0.875rem;
      color: var(--text-muted);
      margin-bottom: 20px;
    }

    /* Contenitore Mirino e Fotocamera */
    .box {
      position: relative;
      width: 100%;
      height: 250px;
      margin: 0 auto;
      overflow: hidden;
      border-radius: 16px;
      background: #000;
      border: 2px solid var(--border-color);
      box-shadow: inset 0 0 12px rgba(0,0,0,0.8);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Area video interattiva */
    #interactive {
      width: 100%;
      height: 100%;
      position: relative;
    }

    #interactive video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* Placeholder di caricamento o errore visivo dentro il box */
    .camera-placeholder {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      gap: 12px;
      padding: 20px;
      background: rgba(15, 23, 42, 0.9);
      z-index: 5;
    }

    .camera-placeholder svg {
      width: 48px;
      height: 48px;
      stroke: var(--text-muted);
    }

    /* Linea laser animata */
    .laser {
      position: absolute;
      left: 5%;
      width: 90%;
      height: 3px;
      background: #ef4444;
      box-shadow: 0 0 12px #ef4444, 0 0 4px #f87171;
      border-radius: 2px;
      z-index: 10;
      animation: scorri 2s infinite ease-in-out alternate;
      pointer-events: none;
    }

    @keyframes scorri {
      0% { top: 12%; opacity: 0.4; }
      100% { top: 88%; opacity: 1; }
    }

    /* Angoli visivi del mirino (overlay overlay stilistico) */
    .viewfinder-corner {
      position: absolute;
      width: 20px;
      height: 20px;
      border: 3px solid var(--accent-color);
      z-index: 11;
      pointer-events: none;
    }
    .top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
    .top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
    .bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
    .bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

    /* Area Stato e Risultati */
    #risultato {
      margin-top: 20px;
      font-size: 0.95rem;
      min-height: 70px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 12px 16px;
      background-color: rgba(255, 255, 255, 0.03);
      border-radius: 12px;
      border: 1px solid var(--border-color);
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 600;
      margin-bottom: 6px;
    }

    .badge-info { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
    .badge-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
    .badge-error { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

    .btn {
      margin-top: 12px;
      padding: 10px 20px;
      border: none;
      border-radius: 8px;
      background: var(--accent-color);
      color: #fff;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
    }

    .btn:hover {
      background: var(--accent-hover);
      transform: translateY(-1px);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn-secondary {
      background: var(--border-color);
      color: var(--text-main);
    }

    .btn-secondary:hover {
      background: #475569;
    }

    /* Icona pulsing di streaming attivo */
    .pulse-dot {
      width: 8px;
      height: 8px;
      background-color: var(--success-color);
      border-radius: 50%;
      box-shadow: 0 0 8px var(--success-color);
      animation: pulse 1.5s infinite;
    }

    @keyframes pulse {
      0% { transform: scale(0.95); opacity: 0.8; }
      50% { transform: scale(1.2); opacity: 1; }
      100% { transform: scale(0.95); opacity: 0.8; }
    }