:root {
    --bg: #0f172a;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-wrapper {
    text-align: center;
}

.glass-calculator {
    width: 340px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.display {
    text-align: right;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.history {
    font-size: 0.9rem;
    color: var(--text-muted);
    height: 1.2rem;
    margin-bottom: 4px;
}

.result {
    font-size: 2.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow-x: auto;
}

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

.key {
    height: 60px;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
}

.key:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.key:active {
    transform: scale(0.95);
}

.key.action { color: #f43f5e; background: rgba(244, 63, 94, 0.1); }
.key.operator { color: #818cf8; background: rgba(129, 140, 248, 0.1); }
.key.equals { 
    background: var(--primary); 
    color: white;
}
.key.equals:hover { 
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.double { grid-column: span 1; } /* Keeps it compact */

.footer-note {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@media (max-width: 400px) {
    .glass-calculator { width: 90vw; }
}
