:root {
    /* Modern Christmas palette */
    --emerald: #10b981;
    --emerald-dark: #059669;
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --crimson: #dc2626;
    --crimson-dark: #991b1b;
    --forest: #065f46;
    --snow: #f8fafc;
    --slate: #1e293b;
    --slate-light: #64748b;
    --white: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f766e 0%, #059669 50%, #10b981 100%);
    height: 100vh; /* Fallback for browsers that don't support svh */
    height: 100svh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    position: relative;
    overflow-y: auto;
}

/* Decorative background elements */
body::before {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    top: -250px;
    right: -250px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 550px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 48px 40px;
    margin: 20px;
    border-radius: 32px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 1;
}

/* Drop cap styling */
.drop-cap {
    font-family: 'Pacifico', cursive;
    font-size: 3.5em;
    line-height: 1;
    display: inline-block;
    margin-right: 0.12em;
    background: linear-gradient(135deg, var(--crimson) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(220, 38, 38, 0.2));
    font-weight: normal;
    vertical-align: baseline;
}

.intro-text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 24px;
    color: var(--slate);
}

.intro-text p {
    margin: 0;
}

/* Message area */
.message-area {
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.message-area.hidden {
    display: none;
}

.error-message {
    color: var(--crimson-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.error-message::before {
    content: '⚠️';
    margin-right: 8px;
    font-size: 1.1em;
}

.error-message:empty {
    display: none;
}

.hint-message {
    color: var(--slate-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.error-message:not(:empty) + .hint-message {
    margin-top: 12px;
}

.hint-message:empty {
    display: none;
}

/* Hint button */
.hint-button {
    background: rgba(100, 116, 139, 0.08);
    color: var(--slate);
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hint-button::before {
    content: '💡';
    font-size: 1.1em;
    margin: 0;
    margin-top: -0.1em;
    padding-bottom: 0.2em;
}

.hint-button:hover {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold);
    transform: translateY(-1px);
}

.hint-button:active {
    transform: translateY(0);
}

.hint-button.hidden {
    display: none;
}

/* Password form */
.password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    padding: 18px 48px 18px 20px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    color: var(--slate);
    width: 100%;
}

.password-input::placeholder {
    color: var(--slate-light);
}

.password-input:focus {
    outline: none;
    border-color: var(--emerald);
    background: white;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.clear-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-light);
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.clear-button:hover {
    background: rgba(100, 116, 139, 0.1);
    color: var(--slate);
    opacity: 1;
}

.clear-button:active {
    transform: translateY(-50%) scale(0.9);
}

.clear-button.hidden {
    display: none;
}

.submit-button {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--forest) 100%);
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.submit-button:active {
    transform: translateY(0);
}

/* Mobile-specific fixes */
@media (max-width: 767px) {
    .container {
        margin: 16px;
        padding: 32px 24px;
        min-height: auto;
    }

    .drop-cap {
        font-size: 3em;
    }

    .intro-text {
        font-size: 1rem;
    }
}

/* Tablet and desktop */
@media (min-width: 768px) {
    .container {
        padding: 56px 48px;
    }

    .drop-cap {
        font-size: 4em;
    }

    .intro-text {
        font-size: 1.1rem;
        margin-bottom: 28px;
    }

    .password-form {
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
    }

    .password-input-wrapper {
        flex: 1;
    }

    .submit-button {
        flex: 0 0 auto;
        min-width: 160px;
    }
}
