// duel-auth.jsx — GTO Duel auth (sign in / forgot / sign-up flow) + empty & error states.
// Dark theme on OctopiPoker tokens. Depends on duel-shared.jsx (ScreenShell, DarkCard, Eyebrow).
// Exports (to window): SignInScreen, SignUpFlow, EmptyState, ErrorScreen

function CloseBar({ title, onClose }) {
  return (
    <div style={{ position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '52px 16px 14px', borderBottom: '1px solid rgba(255,255,255,0.06)', background: 'rgba(11,12,19,0.6)', backdropFilter: 'blur(8px)' }}>
      <button onClick={onClose} className="op-tap" aria-label="Close" style={{ position: 'absolute', left: 14, bottom: 10, width: 34, height: 34, borderRadius: 999, cursor: 'pointer', background: 'none', border: 'none', color: 'rgba(255,255,255,0.7)', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 0 }}>
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round"><path d="M6 6l12 12M18 6L6 18" /></svg>
      </button>
      <span style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 17, color: '#fff' }}>{title}</span>
    </div>
  );
}

function AuthInput({ label, placeholder, value, onChange, type = 'text', error, eye }) {
  const [show, setShow] = React.useState(false);
  const isPw = type === 'password';
  const inputType = isPw && show ? 'text' : type;
  const borderColor = error ? 'var(--op-red-50)' : 'rgba(255,255,255,0.14)';
  return (
    <div>
      <label style={{ position: 'relative', display: 'block' }}>
        {label && (
          <span style={{ position: 'absolute', top: -8, left: 12, padding: '0 6px', background: '#12131D', zIndex: 1, fontFamily: 'var(--op-font-ui)', fontWeight: 600, fontSize: 11, color: error ? 'var(--op-red-40)' : 'rgba(255,255,255,0.5)' }}>{label}</span>
        )}
        <input
          type={inputType} value={value} placeholder={placeholder}
          onChange={(e) => onChange && onChange(e.target.value)}
          style={{
            width: '100%', boxSizing: 'border-box', background: 'rgba(10,11,17,0.55)',
            border: `1px solid ${borderColor}`, borderRadius: 12, padding: '15px 16px',
            paddingRight: (isPw && eye) ? 46 : 16,
            fontFamily: 'var(--op-font-ui)', fontWeight: 600, fontSize: 15, color: '#fff', outline: 'none',
          }}
        />
        {isPw && eye && (
          <button type="button" onClick={() => setShow((s) => !s)} className="op-tap" aria-label="Toggle password" style={{ position: 'absolute', right: 10, top: '50%', transform: 'translateY(-50%)', background: 'none', border: 'none', cursor: 'pointer', padding: 6, color: 'rgba(255,255,255,0.5)', display: 'flex' }}>
            {show
              ? <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z" /><circle cx="12" cy="12" r="3" /></svg>
              : <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M3 3l18 18M10.6 5.1A10.9 10.9 0 0112 5c6.5 0 10 7 10 7a17 17 0 01-3.2 4M6.6 6.6A17 17 0 002 12s3.5 7 10 7a10.9 10.9 0 005.4-1.4" /></svg>}
          </button>
        )}
      </label>
    </div>
  );
}

function ErrorBanner({ text }) {
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 10, background: 'rgba(231,76,60,0.12)', border: '1px solid rgba(231,76,60,0.3)', borderRadius: 12, padding: '13px 15px' }}>
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--op-red-40)" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" style={{ flexShrink: 0 }}><circle cx="12" cy="12" r="9" /><path d="M12 8v5M12 16.5v.01" /></svg>
      <span style={{ fontFamily: 'var(--op-font-ui)', fontWeight: 600, fontSize: 13.5, color: 'var(--op-red-40)' }}>{text}</span>
    </div>
  );
}

function CheckBox({ checked, onChange, children }) {
  return (
    <button onClick={() => onChange(!checked)} className="op-tap" style={{ display: 'flex', alignItems: 'center', gap: 10, background: 'none', border: 'none', cursor: 'pointer', padding: 0, textAlign: 'left' }}>
      <span style={{ width: 22, height: 22, borderRadius: 6, flexShrink: 0, border: checked ? 'none' : '1.5px solid rgba(255,255,255,0.3)', background: checked ? 'var(--op-exodus-70)' : 'transparent', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
        {checked && <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12l5 5L20 6" /></svg>}
      </span>
      <span style={{ fontFamily: 'var(--op-font-ui)', fontWeight: 600, fontSize: 14, color: 'rgba(255,255,255,0.8)' }}>{children}</span>
    </button>
  );
}

function AuthFooter({ backLabel = 'Back', onBack, primaryLabel, onPrimary, enabled = true }) {
  return (
    <div style={{ display: 'flex', gap: 12, padding: '14px 16px 22px', borderTop: '1px solid rgba(255,255,255,0.06)', background: 'rgba(11,12,19,0.6)', backdropFilter: 'blur(8px)' }}>
      <button onClick={onBack} className="op-tap" style={{ flex: 1, cursor: 'pointer', background: 'none', border: '1px solid var(--op-exodus-70)', borderRadius: 12, color: 'var(--op-exodus-50)', padding: '15px 0', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14 }}>{backLabel}</button>
      <button onClick={enabled ? onPrimary : undefined} className="op-tap" disabled={!enabled} style={{
        flex: 1, cursor: enabled ? 'pointer' : 'default', border: 'none', borderRadius: 12,
        background: enabled ? 'linear-gradient(180deg, #7C6BF0, #6C5CE7)' : 'rgba(255,255,255,0.08)',
        color: enabled ? '#fff' : 'rgba(255,255,255,0.3)', padding: '15px 0',
        fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14,
        boxShadow: enabled ? '0 8px 22px rgba(108,92,231,0.45)' : 'none',
      }}>{primaryLabel}</button>
    </div>
  );
}

function GoogleBtn() {
  return (
    <button className="op-tap" style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10, cursor: 'pointer', background: '#fff', border: 'none', borderRadius: 12, padding: '14px 0', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14.5, color: '#1A1D23' }}>
      <svg width="18" height="18" viewBox="0 0 24 24"><path fill="#4285F4" d="M22.6 12.2c0-.7-.1-1.4-.2-2H12v3.8h6c-.3 1.4-1 2.6-2.3 3.4v2.8h3.7c2.1-2 3.2-4.9 3.2-8z" /><path fill="#34A853" d="M12 23c3 0 5.5-1 7.3-2.7l-3.7-2.8c-1 .7-2.3 1.1-3.6 1.1-2.8 0-5.2-1.9-6-4.5H2.2v2.8C4 20.5 7.7 23 12 23z" /><path fill="#FBBC05" d="M6 14.1c-.2-.6-.3-1.3-.3-2s.1-1.4.3-2V7.3H2.2C1.4 8.7 1 10.3 1 12s.4 3.3 1.2 4.7L6 14.1z" /><path fill="#EA4335" d="M12 5.5c1.6 0 3 .5 4.1 1.6l3.1-3.1C17.5 2.2 15 1 12 1 7.7 1 4 3.5 2.2 7.3L6 10.1c.8-2.6 3.2-4.6 6-4.6z" /></svg>
      Continue with Google
    </button>
  );
}

// ───────── Sign In (with inline error + forgot-password view) ─────────
function SignInScreen({ onClose }) {
  const [view, setView] = React.useState('signin'); // signin | forgot
  const [email, setEmail] = React.useState('alma.lawson@example.com');
  const [pw, setPw] = React.useState('');
  const [remember, setRemember] = React.useState(false);
  const [error, setError] = React.useState(false);
  const [fEmail, setFEmail] = React.useState('');

  if (view === 'forgot') {
    return (
      <ScreenShell
        header={<CloseBar title="Forgot Password?" onClose={onClose} />}
        footer={<AuthFooter backLabel="Back" onBack={() => setView('signin')} primaryLabel="Send Reset Link" enabled={/.+@.+\..+/.test(fEmail)} onPrimary={() => {}} />}
      >
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 14, lineHeight: 1.5, color: 'rgba(255,255,255,0.6)', margin: '4px 0 20px' }}>Enter your account&apos;s email address, and we&apos;ll send you a password reset link</p>
        <AuthInput placeholder="Email" value={fEmail} onChange={setFEmail} />
      </ScreenShell>
    );
  }

  return (
    <ScreenShell
      header={<CloseBar title="Sign In" onClose={onClose} />}
      footer={<AuthFooter backLabel="Back" onBack={onClose} primaryLabel="Sign In" enabled={!!pw} onPrimary={() => setError(true)} />}
    >
      <div style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>
        <AuthInput label="Email" value={email} onChange={setEmail} />
        <AuthInput label="Password" type="password" eye value={pw} onChange={(v) => { setPw(v); setError(false); }} error={error} />
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
          <CheckBox checked={remember} onChange={setRemember}>Remember me</CheckBox>
          <button onClick={() => setView('forgot')} className="op-tap" style={{ background: 'none', border: 'none', cursor: 'pointer', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 13.5, color: 'var(--op-exodus-50)' }}>Forgot password?</button>
        </div>
        {error && <div style={{ marginTop: 4 }}><ErrorBanner text="Incorrect password, please try again" /></div>}
      </div>
    </ScreenShell>
  );
}

// ───────── Sign Up flow (choice → profile → verify → terms → success) ─────────
function OTPInput({ value, onChange, len = 6 }) {
  const refs = React.useRef([]);
  const set = (i, ch) => {
    const d = ch.replace(/\D/g, '').slice(-1);
    const arr = value.split('');
    arr[i] = d;
    const next = arr.join('').slice(0, len);
    onChange(next);
    if (d && refs.current[i + 1]) refs.current[i + 1].focus();
  };
  return (
    <div style={{ display: 'flex', gap: 8 }}>
      {Array.from({ length: len }).map((_, i) => {
        const filled = !!value[i];
        return (
          <input key={i} ref={(el) => (refs.current[i] = el)} value={value[i] || ''} inputMode="numeric" maxLength={1}
            onChange={(e) => set(i, e.target.value)}
            onKeyDown={(e) => { if (e.key === 'Backspace' && !value[i] && refs.current[i - 1]) refs.current[i - 1].focus(); }}
            style={{ flex: 1, minWidth: 0, aspectRatio: '1', textAlign: 'center', boxSizing: 'border-box', background: 'rgba(10,11,17,0.55)', border: `1.5px solid ${filled ? 'var(--op-exodus-70)' : 'rgba(255,255,255,0.16)'}`, borderRadius: 12, fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 24, color: '#fff', outline: 'none' }} />
        );
      })}
    </div>
  );
}

function PwRules() {
  const rules = ['At least 8 characters', 'One uppercase letter', 'One lowercase letter', 'One number', 'One special character (!@#$%^&*)'];
  return (
    <div style={{ marginTop: 4 }}>
      <div style={{ fontFamily: 'var(--op-font-ui)', fontWeight: 600, fontSize: 12.5, color: 'rgba(255,255,255,0.55)', marginBottom: 6 }}>Your password must contain:</div>
      <ul style={{ margin: 0, paddingLeft: 18, display: 'flex', flexDirection: 'column', gap: 3 }}>
        {rules.map((r) => <li key={r} style={{ fontFamily: 'var(--op-font-ui)', fontWeight: 400, fontSize: 12.5, color: 'rgba(255,255,255,0.45)' }}>{r}</li>)}
      </ul>
    </div>
  );
}

function SignUpFlow({ onClose }) {
  const [step, setStep] = React.useState(0); // 0 choice,1 profile,2 verify,3 terms,4 success
  const [email, setEmail] = React.useState('');
  const [name, setName] = React.useState('');
  const [pw, setPw] = React.useState('');
  const [pw2, setPw2] = React.useState('');
  const [code, setCode] = React.useState('4519');
  const [agree, setAgree] = React.useState(false);

  React.useEffect(() => {
    if (step === 4) { const t = setTimeout(() => {}, 100); return () => clearTimeout(t); }
    return undefined;
  }, [step]);

  if (step === 0) {
    return (
      <ScreenShell header={<CloseBar title="Sign In or Sign Up" onClose={onClose} />}>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
          <AuthInput placeholder="Email" value={email} onChange={setEmail} />
          <button onClick={() => setStep(1)} disabled={!/.+@.+\..+/.test(email)} className="op-tap" style={{ width: '100%', cursor: /.+@.+\..+/.test(email) ? 'pointer' : 'default', border: 'none', borderRadius: 12, background: /.+@.+\..+/.test(email) ? 'linear-gradient(180deg, #7C6BF0, #6C5CE7)' : 'rgba(255,255,255,0.08)', color: /.+@.+\..+/.test(email) ? '#fff' : 'rgba(255,255,255,0.3)', padding: '15px 0', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14 }}>Next</button>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, color: 'rgba(255,255,255,0.35)' }}>
            <span style={{ flex: 1, height: 1, background: 'rgba(255,255,255,0.1)' }}></span>
            <span style={{ fontFamily: 'var(--op-font-ui)', fontSize: 13 }}>or</span>
            <span style={{ flex: 1, height: 1, background: 'rgba(255,255,255,0.1)' }}></span>
          </div>
          <GoogleBtn />
        </div>
      </ScreenShell>
    );
  }
  if (step === 1) {
    return (
      <ScreenShell header={<CloseBar title="Sign Up" onClose={onClose} />} footer={<AuthFooter onBack={() => setStep(0)} primaryLabel="Next" enabled={!!name && pw.length >= 8 && pw === pw2} onPrimary={() => setStep(2)} />}>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 18, color: '#fff', marginBottom: 18 }}>1. Create your profile</div>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
          <AuthInput placeholder="Profile name" value={name} onChange={setName} />
          <div>
            <AuthInput placeholder="Password" type="password" eye value={pw} onChange={setPw} />
            <PwRules />
          </div>
          <AuthInput placeholder="Re-enter password" type="password" eye value={pw2} onChange={setPw2} />
        </div>
      </ScreenShell>
    );
  }
  if (step === 2) {
    return (
      <ScreenShell header={<CloseBar title="Sign Up" onClose={onClose} />} footer={<AuthFooter onBack={() => setStep(1)} primaryLabel="Next" enabled={code.length === 6} onPrimary={() => setStep(3)} />}>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 18, color: '#fff', marginBottom: 14 }}>2. Enter verification code</div>
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 13.5, color: 'rgba(255,255,255,0.6)', margin: '0 0 18px' }}>Enter code we sent to <span style={{ fontWeight: 700, color: '#fff' }}>{email || 'alma.lawson@example.com'}</span></p>
        <OTPInput value={code} onChange={setCode} />
        <div style={{ textAlign: 'center', marginTop: 18 }}>
          <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 15, color: 'var(--op-exodus-50)' }}>00:23</div>
          <button className="op-tap" style={{ marginTop: 8, background: 'none', border: 'none', cursor: 'pointer', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 13.5, color: 'rgba(255,255,255,0.5)' }}>Resend Code</button>
        </div>
      </ScreenShell>
    );
  }
  if (step === 3) {
    const link = (t) => <a href="#" onClick={(e) => e.preventDefault()} style={{ color: 'var(--op-exodus-50)', textDecoration: 'underline' }}>{t}</a>;
    return (
      <ScreenShell header={<CloseBar title="Sign Up" onClose={onClose} />} footer={<AuthFooter backLabel="Sign Out" onBack={() => setStep(0)} primaryLabel="Next" enabled={agree} onPrimary={() => setStep(4)} />}>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 18, color: '#fff', marginBottom: 16 }}>3. Accept our terms &amp; policies</div>
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 13.5, lineHeight: 1.6, color: 'rgba(255,255,255,0.65)', margin: '0 0 20px' }}>
          By clicking &quot;I agree&quot;, you accept our {link('Terms of Service')}, {link('Privacy Policy')}, {link('Platform Acceptable Use Policy')}, {link('Forum Terms of Service (Buyer)')} and {link('Forum Terms of Service (Seller)')}
        </p>
        <CheckBox checked={agree} onChange={setAgree}>I agree</CheckBox>
      </ScreenShell>
    );
  }
  return (
    <ScreenShell header={<CloseBar title="Sign Up" onClose={onClose} />}>
      <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', minHeight: 360, gap: 16 }}>
        <span style={{ width: 72, height: 72, borderRadius: 999, background: 'var(--op-green-40)', display: 'flex', alignItems: 'center', justifyContent: 'center', boxShadow: '0 0 30px rgba(39,191,105,0.5)' }}>
          <svg width="38" height="38" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12l5 5L20 6" /></svg>
        </span>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 20, color: '#fff', maxWidth: 240 }}>Your account was successfully created!</div>
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 14, lineHeight: 1.5, color: 'rgba(255,255,255,0.55)', margin: 0, maxWidth: 260 }}>You&apos;ll be taken to your first duel in a moment</p>
      </div>
    </ScreenShell>
  );
}

// ───────── Empty state ─────────
function EmptyState({ icon = 'cards', title, body, ctaLabel, onClose, barTitle = 'Duel Profile' }) {
  const icons = {
    cards: <path d="M3 7h13v13H3zM8 4h13v13" />,
    chart: <path d="M4 20V4M4 20h16M8 16v-4M13 16V8M18 16v-7" />,
    trophy: <path d="M7 4h10v4a5 5 0 01-10 0zM5 6H3v1a4 4 0 004 4M19 6h2v1a4 4 0 01-4 4M9 18h6M8 21h8" />,
  };
  return (
    <ScreenShell header={<CloseBar title={barTitle} onClose={onClose} />}>
      <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', minHeight: 420, gap: 16, padding: '0 12px' }}>
        <span style={{ width: 76, height: 76, borderRadius: 999, background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.08)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
          <svg width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="rgba(171,162,241,0.8)" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">{icons[icon]}</svg>
        </span>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 19, color: '#fff' }}>{title}</div>
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 14, lineHeight: 1.5, color: 'rgba(255,255,255,0.5)', margin: 0, maxWidth: 280, textWrap: 'pretty' }}>{body}</p>
        {ctaLabel && (
          <button className="op-tap" style={{ marginTop: 6, cursor: 'pointer', border: 'none', borderRadius: 12, background: 'linear-gradient(180deg, #7C6BF0, #6C5CE7)', color: '#fff', padding: '14px 26px', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14, boxShadow: '0 8px 22px rgba(108,92,231,0.45)' }}>{ctaLabel}</button>
        )}
      </div>
    </ScreenShell>
  );
}

// ───────── Error (server down) ─────────
function ErrorScreen({ onClose }) {
  return (
    <ScreenShell header={<CloseBar title="GTO Duel" onClose={onClose} />}>
      <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', minHeight: 440, gap: 16, padding: '0 12px' }}>
        <span style={{ width: 80, height: 80, borderRadius: 999, background: 'rgba(231,76,60,0.12)', border: '1px solid rgba(231,76,60,0.3)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
          <svg width="38" height="38" viewBox="0 0 24 24" fill="none" stroke="var(--op-red-40)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M22 12a10 10 0 11-5.5-8.9M22 4l-9 9-3-3" opacity="0" /><path d="M12 2a10 10 0 100 20 10 10 0 000-20z" /><path d="M12 8v5M12 16.5v.01" /></svg>
        </span>
        <div style={{ fontFamily: 'var(--op-font-display)', fontWeight: 700, fontSize: 20, color: '#fff' }}>Something went wrong</div>
        <p style={{ fontFamily: 'var(--op-font-ui)', fontSize: 14, lineHeight: 1.55, color: 'rgba(255,255,255,0.55)', margin: 0, maxWidth: 290, textWrap: 'pretty' }}>We couldn&apos;t reach the server. Check your connection and try again — your match progress is safe.</p>
        <button className="op-tap" style={{ marginTop: 6, display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer', border: 'none', borderRadius: 12, background: 'linear-gradient(180deg, #7C6BF0, #6C5CE7)', color: '#fff', padding: '14px 26px', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 14, boxShadow: '0 8px 22px rgba(108,92,231,0.45)' }}>
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"><path d="M21 12a9 9 0 11-3-6.7L21 8" /><path d="M21 3v5h-5" /></svg>
          Try Again
        </button>
        <button className="op-tap" style={{ background: 'none', border: 'none', cursor: 'pointer', fontFamily: 'var(--op-font-ui)', fontWeight: 700, fontSize: 13.5, color: 'rgba(255,255,255,0.5)' }}>Contact support</button>
      </div>
    </ScreenShell>
  );
}

Object.assign(window, { SignInScreen, SignUpFlow, EmptyState, ErrorScreen });
