"use client";

export default function GlobalError({
  error,
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  return (
    <html lang="en">
      <body
        style={{
          margin: 0,
          minHeight: "100vh",
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          background: "#07060a",
          color: "#f3ebe0",
          fontFamily: "system-ui, sans-serif",
          textAlign: "center",
          padding: "1.5rem",
        }}
      >
        <div>
          <h1 style={{ fontSize: "1.5rem", marginBottom: "0.75rem" }}>
            HollowCade hit a hard fault
          </h1>
          <p style={{ color: "#9a8f82", marginBottom: "1.5rem" }}>
            {error.message || "Unexpected error"}
          </p>
          <button
            type="button"
            onClick={reset}
            style={{
              border: "1px solid #f0a030",
              background: "#f0a030",
              color: "#0a0a0a",
              padding: "0.65rem 1.1rem",
              cursor: "pointer",
              fontWeight: 600,
            }}
          >
            Reload
          </button>
        </div>
      </body>
    </html>
  );
}
