/* Font import */
@font-face {
    font-family: 'Chela One Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/chela-one@latest/latin-400-normal.woff2) format('woff2'),
    url(https://cdn.jsdelivr.net/fontsource/fonts/chela-one@latest/latin-400-normal.woff) format('woff');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Modern CSS variables for consistent theming */
:root {
    --primary-color: #412014;
    --primary-color-hover: #2c1913;
    --secondary-color: #a28070;
    --accent-color: #e9d8c4;
    --text-color: #21100a;
    --text-light: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition-short: 0.25s ease;
    --transition-medium: 0.5s ease;
}

/* Add viewport meta tag in HTML head if not already present */
/* <meta name="viewport" content="width=device-width, initial-scale=1.0"> */

/* Base styles */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: 'Chela One Variable', sans-serif;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
    max-width: 1200px;
    padding: 1em;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Responsive Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 0.5em;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin-top: 1.5em;
    margin-bottom: 1em;
    color: var(--primary-color);
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(60px, 10vw, 100px);
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

p, label, input, a, button {
    font-size: clamp(1rem, 2vw, 1.6rem);
    margin-bottom: 1em;
}

/* Difficulty section */
#difficulty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 2em 0;
    width: 100%;
}

#difficulty > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--accent-color);
    padding: 1.5em;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition-short);
    width: 100%;
    max-width: 500px;
}

#difficulty > div:hover {
    transform: translateY(-2px);
}

#difficulty > div > p {
    margin: 0.5em 5px 1.5em;
    font-size: clamp(0.9rem, 1.5vw, 1.4rem);
}

#error{
    display: none;
    color: red;
}

/* Buttons and links */
a, button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    transition: all var(--transition-short);
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 1em 0;
    box-shadow: var(--shadow);
    cursor: pointer;
    border: none;
}

a:hover, button:hover {
    background-color: var(--primary-color-hover);
    transform: translateY(-5px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

a:active, button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form styles */
#form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5em;
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

label {
    font-size: clamp(0.9rem, 1.5vw, 1.4rem);
    color: var(--primary-color);
    text-align: left;
    margin-bottom: 0.5em;
}

input {
    accent-color: var(--primary-color);
    font-family: inherit;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: clamp(0.9rem, 1.5vw, 1.4rem);
}

/* Media queries for different screen sizes */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    main {
        padding: 0.8em;
    }

    #form {
        padding: 1em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    main {
        padding: 0.5em;
    }

    a, button {
        padding: 10px 20px;
        width: 100%;
        max-width: 300px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    a:hover, button:hover {
        transform: none;
        box-shadow: var(--shadow);
    }

    #difficulty > div:hover {
        transform: none;
    }
}