html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    position: relative;
    z-index: 1;
}

.content {
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 4;
}

.keypad-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-100px);
    padding: 0.6rem;
    border-radius: 5px;
    font-size: clamp(0.4rem, 0.9vw, 0.7rem);
    height: min(30px, 4vh);
    text-align: center;
    width: min(120px, 18vw);
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Press Start 2P', cursive;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    word-wrap: break-word;
}

.keypad {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(40px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: min(5px, 0.7vw);
    width: min(150px, 18vw);
    padding: min(6px, 0.8vw);
    border-radius: 10px;
}

.key {
    padding: min(0.3rem, 1vw);    
    border: 2px solid #00ff00;
    border-radius: 50%;
    background: #000000;
    color: #00ff00;
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 5px #00ff00,
        inset 0 0 5px #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.key:hover {
    background: #111111;
    box-shadow: 
        0 0 8px #00ff00,
        inset 0 0 8px #00ff00;
}

.key:active {
    background: #000000;
    box-shadow: 
        0 0 3px #00ff00,
        inset 0 0 10px #00ff00;
    transform: scale(0.95);
}

.key.clear,
.key.enter {
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    font-weight: bold;
    color: #000000;
    border: none;
    background: #00ff00;
    text-shadow: none;
    box-shadow: 
        0 0 5px #00ff00,
        inset 0 0 5px #00ff00;
}

.key.clear {
    background: #00ff00;
}

.key.enter {
    background: #00ff00;
}

.key.clear:hover,
.key.enter:hover {
    background: #00cc00;
    box-shadow: 
        0 0 8px #00ff00,
        inset 0 0 8px #00ff00;
}

@media (max-width: 680px) {
    .content {
        width: 100%;
        padding: 0;
    }
    
    .keypad-display {
        width: min(120px, 32vw);
    }
    
    .keypad {
        width: min(180px, 40vw);
        gap: min(6px, 1vw);
    }
    
    .message {
        font-size: 1.5em;
    }
}

.notification {
    display: none;
}

.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.background-static,
.background-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden {
    display: none;
}

.background-animation:not(.hidden) {
    animation: vaultOpen 3s steps(2) forwards;
}

@keyframes vaultOpen {
    from {
        object-position: center center;
    }
    to {
        object-position: -100% center;
    }
}

.message {
    position: absolute;
    top: -22vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    color: white;
    text-shadow: 0 0 5px #00ff00,
                 0 0 10px #00ff00,
                 0 0 15px #00ff00;
    text-align: center;
    white-space: pre;
    z-index: 5;
    display: none;
    width: 20ch;
    line-height: 1.4;
}

@media (max-width: 430px) {
    .content {
        width: 100%;
        padding: 0;
    }
    
    .keypad-display {
        width: min(120px, 32vw);
        transform: translate(-50%, -50%) translateY(-90px);
    }
    
    .keypad {
        width: min(130px, 40vw);
        gap: min(6px, 1vw);
        transform: translate(-50%, -50%) translateY(35px);
    }
    
    .message {
        top: -25vh;
        font-size: 1.2em;
    }
    
    .background-animation:not(.hidden) {
        animation: none;
        opacity: 0;
        transition: opacity 0.5s ease-out;
    }
    
    .background-animation.opened {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        background: url('path-to-your-second-frame.webp') center center no-repeat;
        background-size: cover;
    }
    
    .background-animation {
        position: fixed;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: translate(-50%, -50%);
        will-change: opacity, transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: -1;
        background: url('path-to-your-first-frame.webp') center center no-repeat;
        background-size: cover;
    }
}

