:root {
    --primary: #FF6B6B;
    --primary-dark: #EE5253;
    --secondary: #4ECDC4;
    --dark: #2C3A47;
    --light: #F7F9FC;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--dark);
    position: relative;
    overflow: hidden;
}

/* Overlay to ensure text readability over the background image */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(44, 58, 71, 0.8), rgba(255, 107, 107, 0.4));
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.joke-card {
    background: var(--glass-bg);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.joke-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.logo h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo i {
    font-size: 1.8rem;
}

.category-badge {
    background: var(--light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(0,0,0,0.05);
}

.joke-content {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
}

.setup-container {
    margin-bottom: 20px;
}

#setup {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--dark);
}

.punchline-container {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    opacity: 1;
    transform: scale(1);
}

.punchline-container.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    height: 0;
    margin: 0;
    overflow: hidden;
}

#punchline {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
    font-family: 'Fredoka', sans-serif;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-controls {
    display: flex;
    gap: 15px;
}

.icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--light);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
}

.icon-btn:hover:not(:disabled) {
    background: #e2e6ea;
    color: var(--primary);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

@media (max-width: 480px) {
    .joke-card {
        padding: 30px 20px;
    }
    
    #setup {
        font-size: 1.3rem;
    }
    
    #punchline {
        font-size: 1.5rem;
    }
}