@font-face {
    font-family: 'TStar';
    src: url('../fonts/TStar-Regular.woff2') format('woff2'),
         url('../fonts/TStar-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TStar';
    src: url('../fonts/TStar-Bold.woff2') format('woff2'),
         url('../fonts/TStar-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TStar';
    src: url('../fonts/TStar-Light.woff2') format('woff2'),
         url('../fonts/TStar-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TStar';
    src: url('../fonts/TStar-Medium.woff2') format('woff2'),
         url('../fonts/TStar-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TStar';
    src: url('../fonts/TStar-Heavy.woff2') format('woff2'),
         url('../fonts/TStar-Heavy.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --color-dark-blue: #00355f;
    --color-white: #ffffff;
    --color-black: #0a0c11;
    --color-grey: #a7a7a7;
    --color-red: #ff0000;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: 'TStar', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #050608 0%, #101218 50%, #090c14 100%);
    background-attachment: fixed;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://egtworld.b-cdn.net/subtle-pattern.png');
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.error-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://egtworld.b-cdn.net/egt-wbg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.3;
    filter: blur(3px);
}

.error-container {
    max-width: 500px;
    width: 90%;
    padding: var(--spacing-lg);
    background-color: rgba(10, 12, 17, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    z-index: 10;
    overflow: hidden;
    animation: fadeIn 1s ease;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.error-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--color-dark-blue) 0%, transparent 70%);
    opacity: 0.2;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.error-container:hover::before {
    opacity: 0.4;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    margin-bottom: 0;
    background: linear-gradient(135deg, #ffffff 60%, #a7a7a7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: -2px;
    line-height: 1;
    animation: pulseError 4s infinite;
    transform-origin: center;
}

.error-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.error-message {
    font-size: 1.1rem;
    color: var(--color-grey);
    margin-bottom: var(--spacing-lg);
    font-weight: 300;
    line-height: 1.6;
}

.home-btn {
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--color-dark-blue) 0%, rgba(0, 40, 80, 1) 100%);
    color: var(--color-white);
    cursor: pointer;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'TStar', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    margin-top: var(--spacing-md);
}

.home-btn .home-icon {
    font-size: 1.1rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-right: 4px;
}

.home-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    z-index: -1;
}

.home-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: all 0.5s ease;
}

.home-btn:hover {
    background: linear-gradient(135deg, var(--color-red) 0%, rgba(180, 0, 0, 1) 100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px) scale(1.05);
    letter-spacing: 2px;
}

.home-btn:hover .home-icon {
    transform: rotate(10deg) scale(1.2);
}

.home-btn:hover::after {
    height: 100%;
    opacity: 1;
}

.home-btn:active {
    transform: translateY(2px) scale(0.98);
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float-up linear infinite;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 53, 95, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 53, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 53, 95, 0);
    }
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.3;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes pulseError {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.error-code {
    background-size: 200% auto;
    animation: gradient-shift 3s ease infinite, pulseError 4s infinite;
}

.error-container:hover .home-btn {
    animation: pulse 1.5s infinite;
}

/* Media Queries */
@media (max-width: 767px) {
    .error-bg {
        background-image: url('https://egtworld.b-cdn.net/egt-mbg.jpg');
    }
    
    .error-code {
        font-size: 6rem;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    .error-message {
        font-size: 1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 12, 17, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-dark-blue), rgba(0, 40, 80, 0.7));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--color-red), rgba(180, 0, 0, 0.7));
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    .error-container {
        background-color: rgba(10, 12, 17, 0.9);
    }
}