* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f6f2ff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #3d3a4c;
    --muted: #6f6b7b;
    --primary: #b897ff;
    --accent: #ffb7d5;
    --accent-strong: #ffe6f6;
    --shadow: 0 24px 80px rgba(110, 90, 170, 0.12);
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(187, 168, 255, 0.4), transparent 28%),
                radial-gradient(circle at bottom right, rgba(255, 183, 213, 0.42), transparent 30%),
                linear-gradient(180deg, #fef7ff 0%, #f1eef8 100%);
    color: var(--text);
    position: relative;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    min-height: 100vh;
}

main.card {
    width: min(100%, 720px);
    max-width: 92ch;
    padding: calc(var(--space-lg) + 1rem);
    border-radius: 40px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

main.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7), transparent 24%),
                radial-gradient(circle at 80% 10%, rgba(255, 183, 213, 0.22), transparent 18%),
                radial-gradient(circle at 50% 120%, rgba(184, 151, 255, 0.18), transparent 20%);
    pointer-events: none;
}

main.card::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 183, 213, 0.2), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

main.card > * {
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 100px;
    height: 100px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(187, 168, 255, 0.85), rgba(255, 183, 213, 0.85));
    margin-bottom: var(--space-lg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8),
                0 8px 32px rgba(187, 168, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: float 3s ease-in-out infinite;
}

.hero-icon span {
    font-size: 2.5rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

h1 {
    margin: 0 0 0.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.25rem, 5vw, 3rem);
    letter-spacing: -0.04em;
    font-weight: 700;
}

p {
    margin: 0 0 var(--space-lg);
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.8;
    color: var(--muted);
    max-width: 480px;
    font-size: 1.05rem;
}

form {
    display: grid;
    gap: var(--space-md);
    width: 100%;
    max-width: 500px;
}

input[type="text"] {
    width: 100%;
    min-height: 64px;
    padding: 0 1.5rem;
    border: 2px solid rgba(123, 101, 197, 0.12);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 255, 0.95));
    font-size: 1.05rem;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

input[type="text"]::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03),
                0 0 0 5px rgba(184, 151, 255, 0.18);
}

button {
    min-height: 64px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.05rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(184, 151, 255, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(184, 151, 255, 0.4);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
}

.button-group {
    display: flex;
    gap: var(--space-md);
    width: 100%;
    max-width: 500px;
    margin-top: calc(var(--space-md) + 0.5rem);
    align-items: center;
    justify-content: center;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 24px 0 0 rgba(184, 151, 255, 0.7), -24px 0 0 rgba(255, 183, 213, 0.7);
    animation: loading-move 1s ease-in-out infinite;
}

@keyframes loading-move {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(14px); }
}

.secondary-button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: none;
}

.secondary-button:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 8px 24px rgba(184, 151, 255, 0.16);
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem;
    }

    main.card {
        padding: 2rem;
        border-radius: 32px;
    }

    .hero-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }

    .hero-icon span {
        font-size: 2rem;
    }

    input[type="text"],
    button {
        min-height: 56px;
        font-size: 1rem;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.75rem;
    }
}

.oracle-portrait {
    position: relative;
    width: 300px;
    height: 300px;
    max-width: 80%;
    aspect-ratio: 1 / 1;
    margin: calc(var(--space-lg)) 0 calc(var(--space-sm));
}

.cat-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    margin: 0;
    background: transparent;
    z-index: 1;
}

.rarity-frame {
    position: absolute;
    top: -48px;
    left: -48px;
    width: 396px;
    height: 396px;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

@media (min-width: 700px) {
    .button-group {
        flex-direction: row;
    }
}

@media (max-width: 699px) {
    .button-group {
        flex-direction: column;
        width: 100%;
    }
}