<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="mobile-web-app-capable">
    <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
    <link rel="icon" href="/favicon.png" type="image/png">
    <link rel="apple-touch-icon" href="/favicon.png">
    <script defer src="/js/tips.js"></script>
    <title>Упс! Ошибка</title>

    <link rel="stylesheet" href="/css/tips.css">
    <style>
        body {
            background-color: #0b0b0c;
            background-image: radial-gradient(circle at 50% 30%, rgba(255, 59, 48, 0.12) 0%, transparent 450px);
            background-attachment: fixed;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            padding: calc(20px + env(safe-area-inset-top, 10px)) 16px calc(20px + env(safe-area-inset-bottom, 16px)) 16px;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        .error-wrapper {
            max-width: 420px;
            width: 100%;
            margin: 0 auto;
        }

        .error-card {
            background: rgba(26, 27, 31, 0.85);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 59, 48, 0.25);
            border-radius: 28px;
            padding: 40px 24px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 59, 48, 0.1);
            box-sizing: border-box;
            animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .icon-circle-error {
            width: 88px;
            height: 88px;
            background: rgba(255, 59, 48, 0.15);
            border: 1px solid rgba(255, 59, 48, 0.35);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px auto;
            box-shadow: 0 10px 25px rgba(255, 59, 48, 0.2);
        }

        .error-card h2 {
            margin: 0 0 10px 0;
            font-size: 24px;
            font-weight: 800;
            color: #ffffff;
            letter-spacing: -0.4px;
        }

        .error-card p {
            color: #939399;
            font-size: 15px;
            line-height: 1.5;
            margin: 0 0 32px 0;
            word-break: break-word;
        }

        .btn-error-back {
            width: 100%;
            min-height: 54px;
            background: linear-gradient(135deg, #0A84FF 0%, #0060c0 100%);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.2s ease;
            box-shadow: 0 8px 25px rgba(10, 132, 255, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            user-select: none;
            -webkit-user-select: none;
            box-sizing: border-box;
        }
        .btn-error-back:active {
            transform: scale(0.97);
            opacity: 0.9;
        }

        .link-home {
            display: inline-block;
            margin-top: 20px;
            padding: 10px 16px;
            color: #8e8e93;
            font-size: 14px;
            font-weight: 500;
            text-decoration: underline;
            transition: color 0.2s ease;
            user-select: none;
            -webkit-user-select: none;
        }
        .link-home:active {
            color: #ffffff;
        }

        @media (max-width: 360px) {
            .error-card {
                padding: 32px 18px;
                border-radius: 22px;
            }
            .error-card h2 { font-size: 22px; }
            .error-card p { font-size: 14px; margin-bottom: 24px; }
            .icon-circle-error { width: 76px; height: 76px; }
        }
    </style>
</head>
<body>

<div class="error-wrapper">
    <div class="error-card">

        <div class="icon-circle-error">
            <span style="font-size: 42px;">😔</span>
        </div>

        <h2>Произошла ошибка</h2>

        <p>Страница или ресурс не найдены.</p>

        <a class="btn-error-back" href="javascript:history.back()" onclick="triggerHaptic(20)">
            <span>⬅️ Вернуться назад</span>
        </a>

        <div>
            <a class="link-home" href="/" onclick="triggerHaptic(15)">
                На главную страницу
            </a>
        </div>

    </div>
</div>

<script>
    function triggerHaptic(pattern = 25) {
        if (window.navigator && window.navigator.vibrate) {
            window.navigator.vibrate(pattern);
        }
    }

    document.addEventListener("DOMContentLoaded", function() {
        triggerHaptic([50, 50, 50]);
    });
</script>

</body>
</html>