body {
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    background-color: #FFEB3B; /* Bright yellow */
}

.app-container {
    display: flex;
    flex-direction: column;
    /* Use dynamic viewport height for mobile browsers */
    height: 100dvh; 
    width: 100vw;
    box-sizing: border-box;
}

.display-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    /* Updated font size */
    font-size: 30rem; 
    
    font-weight: 700;
    line-height: 1; /* Ensures the tall font doesn't add extra vertical space */
    color: #E91E63;
    text-shadow: 4px 4px 0px #F8BBD0, 8px 8px 0px rgba(0,0,0,0.1);
    
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    
    /* The transition for the pop effect */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.keypad {
    /* Lock the keypad height so it doesn't get squashed or pushed off */
    height: 40%; 
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr); /* 4 rows to include the 0 row */
    gap: 8px;
    padding: 10px;
    background-color: #4CAF50;
    box-sizing: border-box;
}

.num-btn {
    border: none;
    border-radius: 20px;
    height: 100%;
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #2E7D32;
    transition: transform 0.1s, box-shadow 0.1s;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.num-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #2E7D32;
}

/* Colors for variety */
.num-btn[data-num="1"], .num-btn[data-num="4"], .num-btn[data-num="7"] { background-color: #FF5722; box-shadow: 0 6px 0 #BF360C; }
.num-btn[data-num="2"], .num-btn[data-num="5"], .num-btn[data-num="8"] { background-color: #2196F3; box-shadow: 0 6px 0 #0D47A1; }
.num-btn[data-num="3"], .num-btn[data-num="6"], .num-btn[data-num="9"] { background-color: #9C27B0; box-shadow: 0 6px 0 #4A148C; }

.zero {
    /* Span only 1 row now that we have 4 rows defined */
    grid-column: span 3;
    background-color: #FF9800 !important;
    box-shadow: 0 6px 0 #E65100 !important;
}

/* Animation class */
.pop {
    transform: scale(1.2);
}

.pop-animation {
    animation: squeeze-and-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes squeeze-and-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); } /* Grows slightly */
    100% { transform: scale(1); }  /* Shrinks back to original size */
}
