@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --warm-50: #fdf8f1;
    --warm-100: #faf0dd;
    --warm-200: #f5e0b9;
    --warm-300: #efc98a;
    --warm-400: #e9cea3;
    --warm-500: #dbb16a;
    --warm-600: #c8954d;
    --warm-700: #a6763e;
    --warm-800: #875f38;
    --warm-900: #6e4e30;
    --warm-950: #3c2a17;

    --ink-50: #f7f6f4;
    --ink-100: #ebe8e1;
    --ink-200: #d6cfc2;
    --ink-300: #baaf9b;
    --ink-400: #9c8d74;
    --ink-500: #837359;
    --ink-600: #6b5c47;
    --ink-700: #574a3a;
    --ink-800: #4a3f33;
    --ink-900: #41382e;
    --ink-950: #231e18;

    --accent: #c2410c;
    --accent-soft: #ea580c;
    --accent-deep: #9a3412;
    --error: #b91c1c;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: #f4e4c4;
    background-image:
        radial-gradient(at 18% 0%, rgba(255, 241, 214, 0.9) 0px, transparent 55%),
        radial-gradient(at 92% 8%, rgba(255, 250, 240, 0.85) 0px, transparent 50%),
        radial-gradient(at 78% 100%, rgba(219, 177, 106, 0.35) 0px, transparent 60%),
        radial-gradient(at 0% 92%, rgba(239, 201, 138, 0.5) 0px, transparent 55%),
        linear-gradient(180deg, #f6e6c6 0%, #eddbb2 100%);
    color: var(--ink-950);
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(110, 78, 48, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 78, 48, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    z-index: 0;
}

::selection {
    background: rgba(194, 65, 12, 0.18);
    color: var(--warm-950);
}

.container {
    text-align: center;
    padding: 3.5rem 2.5rem;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.82) 0%,
        rgba(255, 255, 255, 0.62) 100%);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 2px 6px rgba(60, 42, 23, 0.05),
        0 24px 56px -20px rgba(60, 42, 23, 0.28);
    width: 440px;
    max-width: 90%;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

h1 {
    font-family: var(--font-sans);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ink-950);
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}

.loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.loader p {
    color: var(--ink-600);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(200, 149, 77, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    padding: 2rem 0;
}

.error-message p {
    color: var(--error);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.back-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
    color: #fff8ee;
    background: linear-gradient(180deg, #3c2a17 0%, #231e18 100%);
    border: 1px solid rgba(60, 42, 23, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 10px 24px -10px rgba(60, 42, 23, 0.55);
    cursor: pointer;
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 220ms ease,
                background 220ms ease;
}

.back-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #4a3820 0%, #2f2519 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 16px 32px -12px rgba(60, 42, 23, 0.65);
}

.back-button:active {
    transform: translateY(0px) scale(0.98);
}

@media (max-width: 480px) {
    .container {
        padding: 2.5rem 1.5rem;
        border-radius: 22px;
    }

    h1 {
        font-size: 3rem;
    }
}
