.container {
    width: 95vw;
    max-width: 500px;
}

body {
    background: #0d0f1a;
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
    position: relative;
}

h1 {
    font-size: clamp(26px, 5vw, 36px);
    letter-spacing: 2px;
}

.grid {
    grid-template-columns: repeat(3, 80px);
    display: grid;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
    transition: 0.6s ease;
}

.square {
    width: 80px;
    height: 80px;
    background: #1b1e2e;
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.square:hover {
    transform: scale(1.05);
}

.square.active {
    background: #4c6fff;
    box-shadow: 0 0 20px #4c6fff;
}

.grid.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

#message {
    margin-top: 20px;
    font-weight: bold;
    opacity: 0;
    transition: 0.3s ease;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #4c6fff;
    border-radius: 50%;
    pointer-events: none;
    animation: burst 700ms ease-out forwards;
}

@keyframes burst {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y));
        opacity: 0;
    }
}


/* ---------- LOCK II CIPHER STAGE ---------- */

.cipher-stage {
    width: 100%;
    max-width: 800px;
    text-align: center;
    animation: fadeInStage 0.6s ease forwards;
}

@keyframes fadeInStage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cipher-stage h2 {
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.cipher-stage p {
    color: #aaa;
    margin-bottom: 20px;
}

.cipher-input {
    padding: 12px;
    width: 220px;
    background: #1b1e2e;
    border: 2px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: 0.2s ease;
}

.cipher-input:focus {
    border-color: #4c6fff;
    box-shadow: 0 0 15px rgba(76, 111, 255, 0.4);
}

.cipher-button {
    margin-top: 15px;
    padding: 10px 25px;
    background: #4c6fff;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}

.cipher-button:hover {
    background: #3654d4;
    transform: scale(1.05);
}

#stageContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    position: relative;
}

.cipher-stage {
    width: 100%;
    max-width: 300px;
    text-align: center;
    animation: fadeInStage 0.6s ease forwards;
}

.cipher-input {
    width: 100%;
    box-sizing: border-box;
}


/* stage fade transitions */

#stageContainer.fade-out {
    opacity: 0;
    transform: scale(0.97);
    transition: 0.6s ease;
}

.stage-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInStage 0.6s ease forwards;
}


/* ---- Keypad Lock UI ---- */

.keypad {
    width: 100%;
    max-width: 300px;
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.key {
    width: 100%;
    aspect-ratio: 1.2 / 1;
    font-size: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(0, 0, 0, .18);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: 0.15s ease;
}

.key:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .06);
}

.key:active {
    transform: translateY(1px);
}

.key.primary {
    background: #4c6fff;
    border-color: rgba(255, 255, 255, .18);
}

.key.primary:hover {
    background: #3654d4;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
}

.dot.filled {
    background: #4c6fff;
    box-shadow: 0 0 12px rgba(76, 111, 255, .55);
}


/* ---- Congrats + Letter screens ---- */

.big-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 5vw, 42px);
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-align: center;
}

.letter {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.9;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 50px;
    width: 100%;
    max-width: 1100px;
    /* 🔥 MUCH wider */
    margin: 30px auto;
    text-align: left;
    box-sizing: border-box;
    max-height: 80vh;
    overflow-y: auto;
}

.cipherletter-stage {
    text-align: center;
    animation: fadeInStage 0.6s ease forwards;
    width: 100%;
    max-width: 1200px;
}


/* stage fade helper (if not already present) */

#stageContainer.fade-out {
    opacity: 0;
    transform: scale(0.97);
    transition: 0.6s ease;
}

.gift-card {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.gift-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    margin-bottom: 8px;
}

.gift-text {
    opacity: 0.8;
    margin-bottom: 18px;
}

.gift-card-box {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 22px;
    border-radius: 18px;
    max-width: 320px;
    margin: 0 auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transition: 0.3s ease;
}

.gift-button {
    margin-top: 12px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #ff3c00;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.gift-button:hover {
    transform: scale(1.05);
}

.hidden-code {
    margin-top: 10px;
    opacity: 0;
    transition: 0.4s ease;
    font-weight: bold;
    letter-spacing: 2px;
}

.letter-photo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.letter-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 192, 203, 0.3);
    /* soft pink glow */
}