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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.calculator-container {
    perspective: 1000px;
}

.calculator {
    background: linear-gradient(145deg, #3a4a5c, #2d3a4a);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid #4a5a6c;
    max-width: 400px;
    width: 100%;
    transform: rotateX(5deg);
}

.display {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #333;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.stack-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stack-register {
    background: #0a0a0a;
    color: #00ff00;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    min-width: 80px;
    text-align: right;
    border: 1px solid #333;
}

.main-display {
    background: #0a0a0a;
    color: #00ff00;
    padding: 15px;
    border-radius: 8px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    text-align: right;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border: 1px solid #333;
    word-break: break-all;
}

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

.btn {
    background: linear-gradient(145deg, #4a5a6c, #3a4a5c);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    padding: 15px 8px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid #5a6a7c;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn:hover {
    background: linear-gradient(145deg, #5a6a7c, #4a5a6c);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn.number {
    background: linear-gradient(145deg, #5a6a7c, #4a5a6c);
    color: #ffffff;
}

.btn.number:hover {
    background: linear-gradient(145deg, #6a7a8c, #5a6a7c);
}

.btn.operator {
    background: linear-gradient(145deg, #8b4513, #6b3413);
    color: #ffffff;
}

.btn.operator:hover {
    background: linear-gradient(145deg, #9b5513, #7b4413);
}

.btn.function {
    background: linear-gradient(145deg, #2c5aa0, #1c4a90);
    color: #ffffff;
    font-size: 12px;
}

.btn.function sup {
    font-size: 10px;
    vertical-align: super;
}

.btn.function:hover {
    background: linear-gradient(145deg, #3c6ab0, #2c5aa0);
}

/* Specific button styling */
.btn[data-action="enter"] {
    background: linear-gradient(145deg, #228b22, #1a7a1a);
    grid-column: span 2;
}

.btn[data-action="enter"]:hover {
    background: linear-gradient(145deg, #32ab32, #228b22);
}

.btn[data-action="clr"] {
    background: linear-gradient(145deg, #dc143c, #bc133c);
}

.btn[data-action="clr"]:hover {
    background: linear-gradient(145deg, #ec244c, #cc233c);
}

.btn[data-number="0"] {
    grid-column: span 2;
}

/* Responsive design */
@media (max-width: 480px) {
    .calculator {
        padding: 15px;
        margin: 10px;
    }
    
    .btn {
        padding: 12px 6px;
        font-size: 12px;
        min-height: 45px;
    }
    
    .main-display {
        font-size: 20px;
        padding: 12px;
    }
    
    .stack-register {
        font-size: 10px;
        padding: 4px 8px;
        min-width: 60px;
    }
}

@media (max-width: 360px) {
    .btn {
        padding: 10px 4px;
        font-size: 11px;
        min-height: 40px;
    }
    
    .main-display {
        font-size: 18px;
        padding: 10px;
    }
}

/* Animation for button press */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn.pressed {
    animation: buttonPress 0.1s ease;
}

/* Glow effect for display */
.main-display {
    text-shadow: 0 0 5px #00ff00;
}

.stack-register {
    text-shadow: 0 0 3px #00ff00;
}

/* Vintage calculator bezel effect */
.calculator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6a7a8c, #4a5a6c, #6a7a8c);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
}

.calculator {
    position: relative;
}
