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

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

.berry-gradient {
    background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 50%, #6c5b7b 100%);
    animation: gradient-shift 15s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.calculator-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.display-container {
    position: relative;
    margin-bottom: 20px;
}

.display {
    background: linear-gradient(135deg, #2d1b3d 0%, #1a1a2e 100%);
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    padding: 20px;
    border-radius: 16px;
    text-align: right;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 136, 0.2);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.operation-indicator {
    position: absolute;
    top: 8px;
    right: 20px;
    font-size: 1rem;
    color: #ff6b9d;
    font-weight: bold;
}

.berry-pop {
    position: absolute;
    font-size: 2rem;
    animation: berry-pop-animation 1s ease-out;
}

@keyframes berry-pop-animation {
    0% { transform: scale(0) translateY(0); opacity: 1; }
    50% { transform: scale(1.5) translateY(-20px); opacity: 1; }
    100% { transform: scale(1) translateY(-40px); opacity: 0; }
}

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

.button {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.button:active::before {
    width: 200px;
    height: 200px;
}

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

.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-number {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #333;
}

.btn-number:hover {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
}

.btn-operation {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    color: white;
}

.btn-operation:hover {
    background: linear-gradient(135deg, #ff8fab 0%, #ffa8c0 100%);
}

.btn-equals {
    background: linear-gradient(135deg, #ff3366 0%, #ff6699 100%);
    color: white;
    font-weight: 700;
}

.btn-equals:hover {
    background: linear-gradient(135deg, #ff4477 0%, #ff77aa 100%);
}

.btn-clear {
    background: linear-gradient(135deg, #ff9f43 0%, #ffb366 100%);
    color: white;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #ffb366 0%, #ffc688 100%);
}

.btn-special {
    background: linear-gradient(135deg, #c06c84 0%, #d88a9a 100%);
    color: white;
}

.btn-special:hover {
    background: linear-gradient(135deg, #d88a9a 0%, #e5a3b1 100%);
}

.btn-memory {
    background: linear-gradient(135deg, #6c5b7b 0%, #8b7a9b 100%);
    color: white;
    font-size: 1rem;
}

.btn-memory:hover {
    background: linear-gradient(135deg, #8b7a9b 0%, #a599bb 100%);
}

.history-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.history-panel::-webkit-scrollbar {
    width: 8px;
}

.history-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.history-panel::-webkit-scrollbar-thumb {
    background: #ff6b9d;
    border-radius: 4px;
}

.easter-egg {
    background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    animation: slide-down 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slide-down {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ff6b9d, #ffd700, #00ff88, #6c5b7b);
    top: -10px;
    animation: confetti-fall 2s ease-out forwards;
    border-radius: 50%;
}

@keyframes confetti-fall {
    to {
        transform: translateY(400px) rotate(360deg);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .display {
        font-size: 2rem;
        padding: 16px;
        min-height: 60px;
    }

    .button {
        padding: 16px;
        font-size: 1.25rem;
    }

    .btn-memory {
        font-size: 0.875rem;
    }

    .button-grid {
        gap: 8px;
    }

    .calculator-body {
        padding: 16px;
    }
}