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

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

.container {
    perspective: 1000px;
}

.calculator.sr56 {
    width: 320px;
    height: 480px;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
    position: relative;
}

.calculator-header {
    text-align: center;
    color: #ccc;
    margin-bottom: 15px;
    user-select: none;
}

.brand-name {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.model-name {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.programmable {
    font-size: 9px;
    font-style: italic;
    margin-top: 2px;
    opacity: 0.8;
}

.angle-switch {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    border: 1px solid #555;
}

.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: bold;
    color: #ccc;
    transition: all 0.2s;
}

.switch-label input {
    display: none;
}

.switch-label input:checked + span {
    background: #ff6b35;
    color: white;
    border-radius: 2px;
}

.display {
    background: #000;
    height: 60px;
    margin: 15px 0 20px 0;
    border-radius: 8px;
    border: 3px solid #333;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 15px;
    box-shadow: 
        inset 0 3px 10px rgba(0, 0, 0, 0.8),
        inset 0 -1px 3px rgba(255, 255, 255, 0.1);
    position: relative;
}

.display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 75%,
        transparent 100%
    );
    border-radius: 5px;
    pointer-events: none;
}

.result {
    color: #ff4444;
    font-size: 28px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px #ff4444;
    letter-spacing: 1px;
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.btn {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: none;
    border-radius: 6px;
    height: 35px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border: 1px solid #555;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    text-align: center;
}

.btn:hover {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.8),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn.number {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    color: white;
}

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

.btn.operator {
    background: linear-gradient(145deg, #ff6b35, #e55a2b);
    color: white;
}

.btn.operator:hover {
    background: linear-gradient(145deg, #ff7b45, #f56a3b);
}

.btn.function {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #ccc;
}

.btn.function:hover {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    color: white;
}

.btn.equals {
    background: linear-gradient(145deg, #27ae60, #219a52);
    color: white;
}

.btn.equals:hover {
    background: linear-gradient(145deg, #37be70, #279a62);
}

.btn.wide {
    grid-column: span 2;
}

.btn .secondary {
    font-size: 7px;
    color: #ff6b35;
    margin-bottom: 1px;
    opacity: 0.8;
}

.btn .primary {
    font-size: 9px;
    color: inherit;
    font-weight: bold;
}

.btn.second-active .secondary {
    color: #fff;
    background: #ff6b35;
    padding: 1px 2px;
    border-radius: 2px;
}

.btn.second-active .primary {
    opacity: 0.5;
}

@media (max-width: 480px) {
    .calculator.sr56 {
        width: 280px;
        height: 420px;
        padding: 15px;
    }
    
    .display {
        height: 50px;
    }
    
    .result {
        font-size: 24px;
    }
    
    .btn {
        height: 30px;
        font-size: 8px;
    }
    
    .btn .secondary {
        font-size: 6px;
    }
    
    .btn .primary {
        font-size: 8px;
    }
    
    .model-name {
        font-size: 20px;
    }
}

@keyframes press {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn:active {
    animation: press 0.1s ease-in-out;
}