:root {
    color-scheme: dark;
    --page-background: radial-gradient(circle at top, #33201f 0%, #140f13 45%, #09080a 100%);
    --text-color: #f5efe8;
    --muted-text: #d6c8bc;
    --panel-background: rgba(26, 18, 24, 0.9);
    --panel-border: rgba(255, 255, 255, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.45);
    --input-background: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.18);
    --button-background: #a63a2f;
    --button-hover: #bf4b3f;
    --button-text: #fff9f4;
    --toggle-background: rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] {
    color-scheme: light;
    --page-background: radial-gradient(circle at top, #fff6e5 0%, #f4e0c6 48%, #e0cab1 100%);
    --text-color: #2a1712;
    --muted-text: #5c4337;
    --panel-background: rgba(255, 250, 242, 0.92);
    --panel-border: rgba(108, 72, 53, 0.16);
    --shadow-color: rgba(88, 61, 46, 0.18);
    --input-background: rgba(255, 255, 255, 0.9);
    --input-border: rgba(108, 72, 53, 0.2);
    --button-background: #7f352a;
    --button-hover: #944133;
    --button-text: #fffaf6;
    --toggle-background: rgba(127, 53, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--page-background);
    color: var(--text-color);
    font-family: Georgia, "Times New Roman", serif;
    text-align: center;
    transition: background 0.35s ease, color 0.35s ease;
}

.container {
    width: min(100%, 520px);
    padding: 32px;
    border-radius: 24px;
    background: var(--panel-background);
    border: 1px solid var(--panel-border);
    box-shadow: 0 24px 60px var(--shadow-color);
    backdrop-filter: blur(12px);
}

.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.theme-label {
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-text);
}

.theme-toggle {
    padding: 10px 16px;
    border: 1px solid var(--panel-border);
    background: var(--toggle-background);
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    letter-spacing: 0.04em;
}

p {
    color: var(--muted-text);
}

input[type="text"] {
    width: 100%;
    margin: 20px 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    background: var(--input-background);
    color: var(--text-color);
    border-radius: 14px;
    font: inherit;
    transition: border-color 0.25s ease, background 0.25s ease;
}

input[type="text"]::placeholder {
    color: var(--muted-text);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--button-background);
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    background: var(--button-background);
    color: var(--button-text);
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.25s ease;
}

button:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

button:focus-visible,
input[type="text"]:focus-visible {
    outline: 2px solid var(--button-background);
    outline-offset: 3px;
}

#predict-button {
    min-width: 220px;
}

#result {
    min-height: 3.2em;
    margin-top: 24px;
    font-size: 1.15rem;
    line-height: 1.5;
}

@media (max-width: 520px) {
    .container {
        padding: 24px;
    }

    .theme-switcher {
        flex-direction: column;
    }

    #predict-button,
    .theme-toggle {
        width: 100%;
    }
}
