/* ===== CSS Variables ===== */
:root {
    --bg-cream: #F5F5EA;
    --bg-cream-dark: #E6E6CE;
    --forest: #1A4C35;
    --text-dark: #2A2A2A;
    --font-handwritten: 'Caveat', cursive;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    
    /* Subtle paper texture effect */
    background-image: 
        radial-gradient(ellipse at 20% 30%, rgba(200, 195, 170, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(200, 195, 170, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px 50px 0;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 0;
}

.logo-icon {
    width: 70px;
    height: 55px;
}

.logo-text {
    font-family: var(--font-handwritten);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: -3px;
    letter-spacing: 1px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 16px;
    background: var(--bg-cream-dark);
    border: 2.5px solid var(--forest);
    border-radius: 40px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--forest);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: -0.006em;
}

.login-btn:hover {
    background: var(--forest);
    color: var(--bg-cream);
}

.login-btn:hover .login-icon {
    stroke: var(--bg-cream);
}

.login-icon {
    width: 20px;
    height: 20px;
    stroke: var(--forest);
    transition: stroke 0.3s ease;
}

/* ===== Character Selection ===== */
.character-selection {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.characters {
    display: flex;
    align-items: flex-end; /* Align bottoms for consistent height */
    justify-content: center;
    gap: 80px;
}

.character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.character-card:hover {
    transform: scale(1.08);
}

.character-card:active {
    transform: scale(0.98);
}

/* Character Wrapper - Fixed height for alignment */
.character-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 270px; /* Fixed height to align characters */
}

/* Character Image */
.character-image {
    width: auto;
    height: 240px; /* 50% bigger */
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
    transition: filter 0.3s ease;
}

.character-card:hover .character-image {
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.12));
}

/* Character Name */
.character-name {
    font-family: var(--font-handwritten);
    font-size: 2.8rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-top: 20px;
    letter-spacing: 2px;
}

/* ===== Hover Animations ===== */
.character-card .character-image {
    animation: float 4s ease-in-out infinite;
}

.character-card:nth-child(1) .character-image {
    animation-delay: 0s;
}

.character-card:nth-child(2) .character-image {
    animation-delay: -2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ===== Selection State ===== */
.character-card.selected {
    transform: scale(1.1);
}

.character-card.selected .character-name {
    font-weight: 700;
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 900px) {
    .header {
        padding: 30px 30px 0;
    }
    
    .characters {
        gap: 50px;
    }
    
    .character-wrapper {
        height: 225px;
    }
    
    .character-image {
        height: 195px;
    }
    
    .character-name {
        font-size: 2.4rem;
    }
}

/* Mobile - Stack vertically */
@media (max-width: 600px) {
    .header {
        padding: 25px 20px 0;
        align-items: center;
    }
    
    .logo-icon {
        width: 55px;
        height: 42px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .login-btn {
        padding: 10px 14px;
        font-size: 14px;
        border-width: 2px;
    }
    
    .login-icon {
        width: 18px;
        height: 18px;
    }
    
    .character-selection {
        padding: 10px 20px 40px;
    }
    
    .characters {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    
    .character-wrapper {
        height: 210px;
    }
    
    .character-image {
        height: 180px;
    }
    
    .character-name {
        font-size: 2.2rem;
        margin-top: 15px;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .header {
        padding: 20px 15px 0;
    }
    
    .logo-icon {
        width: 45px;
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .login-btn {
        padding: 8px 12px;
        font-size: 13px;
        gap: 4px;
    }
    
    .login-icon {
        width: 16px;
        height: 16px;
    }
    
    .character-wrapper {
        height: 180px;
    }
    
    .character-image {
        height: 150px;
    }
    
    .character-name {
        font-size: 1.8rem;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .character-wrapper {
        height: 330px;
    }
    
    .character-image {
        height: 300px;
    }
    
    .character-name {
        font-size: 3.2rem;
    }
    
    .characters {
        gap: 120px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.2s !important;
    }
}
