@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Orbitron:wght@500&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
    color: white;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
}

.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

#password-screen {
    animation: fadeIn 2s ease-out;
}

input[type="password"] {
    font-size: 2rem;
    padding: 0.5rem;
    background: transparent;
    color: cyan;
    border: 2px solid cyan;
    border-radius: 5px;
    text-align: center;
    letter-spacing: 1rem;
    width: 200px;
    margin-top: 1rem;
    outline: none;
}

#unlock-btn {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: cyan;
    color: black;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

#unlock-btn:hover {
    background: white;
}

#error-msg {
    color: red;
    margin-top: 1rem;
}

#letter-container {
    display: none;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.svg-envelope {
    width: 400px;
    height: 280px;
    background: #d8cfc4;
    border: 2px solid #ccc;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
    transition: all 2s ease;
    overflow: hidden;
}

/* Left diagonal fold */
.svg-envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    border-top: 2px solid #b0a89c;
    border-right: 2px solid transparent;
    transform: skewY(45deg);
    transform-origin: top left;
    pointer-events: none;
}

/* Right diagonal fold */
.svg-envelope::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    border-top: 2px solid #b0a89c;
    border-left: 2px solid transparent;
    transform: skewY(-45deg);
    transform-origin: top right;
    pointer-events: none;
}

.svg-envelope.opened {
    height: 90vh;
    width: 70vw;
    transition: height 1s ease-in-out, width 1s ease-in-out;
}

.svg-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: url('seal.png') no-repeat center center/contain;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6));
    z-index: 3;
    transition: transform 1s ease, opacity 1s ease;
}

.svg-seal.break {
    transform: scale(1.5) rotate(45deg);
    opacity: 0;
}

.svg-letter {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff0e5;
    padding: 4rem 3rem;
    font-family: 'Great Vibes', cursive;
    font-size: 1.8rem;
    color: #222;
    line-height: 2.2rem;
    z-index: 2;
    opacity: 0;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
    transition: opacity 1s ease;
    white-space: pre-line;
    padding-bottom: 120px;
}

.svg-letter.reveal {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}

.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particles canvas {
    display: block;
}

.letter-seal {
    position: sticky;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
    width: 100px;
    height: 100px;
    background: url('seal.png') no-repeat center center/contain;
    z-index: 3;
    pointer-events: auto;
    cursor: pointer;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.letter-seal:hover {
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6));
    transform: translateX(-50%) scale(1.05);
    scale: 1.07;
}