@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    overflow-x: hidden;
}

.berry-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
}

.calculator-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.calculator-body {
    background: #2a2a2a;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.calculator-display {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px 20px;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.display-text {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ff88;
    text-align: right;
    word-break: break-all;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    animation: display-flicker 0.1s;
}

@keyframes display-flicker {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}

.berry-pop {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 2rem;
    animation: berry-bounce 0.6s ease-out;
    pointer-events: none;
}

@keyframes berry-bounce {
    0% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.calc-button {
    height: 70px;
    border-radius: 10px;
    border: none;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.calc-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-number {
    background: #333;
    color: white;
}

.btn-number:hover {
    background: #444;
}

.btn-special {
    background: #a5a5a5;
    color: #1a1a1a;
}

.btn-special:hover {
    background: #b8b8b8;
}

.btn-operation {
    background: #ff9500;
    color: white;
}

.btn-operation:hover {
    background: #ffaa33;
}

.btn-equals {
    background: #ff9500;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 149, 0, 0.4), 
                0 0 20px rgba(255, 149, 0, 0.2);
}

.btn-equals:hover {
    background: #ffaa33;
    box-shadow: 0 6px 12px rgba(255, 149, 0, 0.5),
                0 0 30px rgba(255, 149, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .calculator-body {
        padding: 16px;
    }
    
    .display-text {
        font-size: 2rem;
    }
    
    .calc-button {
        height: 60px;
        font-size: 1.25rem;
    }
    
    .button-grid {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .display-text {
        font-size: 1.75rem;
    }
    
    .calc-button {
        height: 55px;
        font-size: 1.1rem;
    }
}

/* Accessibility */
.calc-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}