 * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #020617;
      color: #e5e7eb;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }

    .app {
      width: 100%;
      max-width: 420px;
      background: #0b1120;
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 18px 45px rgba(0,0,0,0.6);
      border: 1px solid rgba(148,163,184,0.2);
    }

    .app h1 {
      font-size: 20px;
      margin-bottom: 4px;
      text-align: center;
    }

    .app p.subtitle {
      font-size: 13px;
      color: #9ca3af;
      text-align: center;
      margin-bottom: 12px;
    }

    .preview-wrapper {
      position: relative;
      width: 100%;
      border-radius: 16px;
      overflow: hidden;
      background: #020617;
      aspect-ratio: 3 / 4; /* mantiene proporción vertical tipo selfie */
      margin-bottom: 10px;
      border: 1px solid rgba(148,163,184,0.3);
    }

    video#camera {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transform: scaleX(-1); /* efecto espejo para selfie */
    }

    /* Imagen del famoso superpuesta */
    img#celebrityOverlay {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain; /* ajusta el PNG al marco */
      pointer-events: none;
    }

    /* Capa de estado (texto de ayuda) */
    .status-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 12px;
      font-size: 14px;
      color: #9ca3af;
      background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.98));
      z-index: 5;
    }

    .status-overlay.hidden {
      display: none;
    }

    .buttons {
      display: flex;
      gap: 8px;
      margin-bottom: 10px;
    }

    button, a.button-link {
      flex: 1;
      padding: 9px 12px;
      border-radius: 999px;
      border: none;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
      text-align: center;
      text-decoration: none;
    }

    button.primary {
      background: linear-gradient(to right, #22c55e, #22d3ee);
      color: #020617;
      box-shadow: 0 8px 20px rgba(34,197,94,0.4);
    }

    button.secondary {
      background: #111827;
      color: #e5e7eb;
      border: 1px solid rgba(148,163,184,0.5);
    }

    button:hover:not(:disabled),
    a.button-link:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    }

    button:active:not(:disabled),
    a.button-link:active {
      transform: translateY(0);
      box-shadow: none;
    }

    button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      box-shadow: none;
    }

    a.button-link {
      background: #1f2937;
      color: #e5e7eb;
      border: 1px solid rgba(148,163,184,0.4);
    }

    .result {
      margin-top: 8px;
    }

    .result-title {
      font-size: 13px;
      color: #9ca3af;
      margin-bottom: 6px;
    }

    img#resultPhoto {
      width: 100%;
      border-radius: 14px;
      display: none;
      border: 1px solid rgba(148,163,184,0.3);
    }

    small.note {
      display: block;
      margin-top: 6px;
      font-size: 11px;
      color: #6b7280;
      text-align: center;
    }