:root {
    --bg-color: #050103;
    --accent-color: #ff1493;
    --accent-glow: rgba(255, 20, 147, 0.4);
    --text-main: #f8edeb;
    --glass-bg: rgba(20, 5, 10, 0.4);
    --glass-border: rgba(255, 20, 147, 0.3);
}

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

body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden; /* Remove scroll inteiro - estilo app/apresentação */
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

/* Background Canvas Matrix */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background-color: #050103;
}

/* Container de Apresentação */
#presentation-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos de Slides */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
    transform: scale(0.95);
    padding: 20px;
    text-align: center;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Slide Lock Background overlay setup */
#slide-lock {
    background: radial-gradient(circle, #ff8da1, #ff4d6d);
    z-index: 50; /* Garante que fica totalmente por cima do canvas */
}
#slide-lock::before {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M20 35l-1.5-1.5C9.5 25.5 3 20 3 13c0-5 4-9 9-9 3 0 5.5 1.5 7.5 3.5C21.5 5.5 24 4 27 4c5 0 9 4 9 9 0 7-6.5 12.5-15.5 20.5L20 35z" fill="rgba(255,255,255,0.15)"/></svg>');
    background-size: 60px 60px;
    z-index: -1;
}

/* Cadeado */
.lock-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lock-shackle {
    width: 140px;
    height: 100px;
    border: 20px solid #f0f0f0;
    border-bottom: 0;
    border-radius: 90px 90px 0 0;
    margin-bottom: -15px;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.lock-shackle.unlocked {
    transform: translateY(-40px);
}
.lock-body {
    background: linear-gradient(145deg, #ff5e7e, #e84566);
    width: 320px;
    border-radius: 20px;
    padding: 40px 20px 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}
.lock-decorations {
    position: absolute;
    width: 100%;
    top: 15px;
    left: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 25px;
    box-sizing: border-box;
}
.heart-left, .heart-right {
    font-size: 1.5rem;
    color: #ff1493;
}
.lock-dials {
    background: #ff7592;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.2);
}
.dial-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.dial-val {
    background: #5c3a21; /* Castanho escuro */
    color: #fceabb;
    font-size: 2.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.6), 0 2px 0 rgba(255,255,255,0.3);
}
.dial-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}
.dial-btn:hover {
    background: rgba(255,255,255,0.4);
}
.dial-btn:active {
    background: rgba(0,0,0,0.2);
}
.lock-hint {
    margin-top: 25px;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Typography & Utils */
.pixel-text {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(2rem, 8vw, 6rem);
    color: #ff1493;
    text-shadow: 0 0 10px #ff1493, 0 0 20px #ff1493;
}

.heart-pixel {
    font-size: clamp(4rem, 12vw, 10rem);
    color: #ff1493;
    display: inline-block;
    animation: heartbeat 1s infinite alternate;
}

.elegant-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.romantic-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: #ff1493;
    margin-bottom: 20px;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
}

.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.hint-text {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-opacity 2s infinite;
}

/* Glass Cards para Memórias */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 20, 147, 0.1);
}

.glass-card p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #f0f0f0;
}

.icon-wrapper {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Spinning Heart Canvas */
#spinning-heart-canvas {
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 0 auto;
    display: block;
}

/* Photo Frame Slide (Substituiu o Timer) */
.m-b { margin-bottom: 30px; }
.text-shadow-pink {
    text-shadow: 0 0 10px #ff1493, 0 0 20px #ff1493;
}

.photo-frame {
    background: #fff;
    padding: 15px 15px 40px 15px; /* Estilo polaroid */
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 25px rgba(255, 20, 147, 0.3);
    border-radius: 4px;
    transform: rotate(-2deg);
    transition: transform 0.5s ease;
    max-width: 80vw;
    margin: 20px auto;
}

.photo-frame:hover {
    transform: rotate(1deg) scale(1.02);
}

.photo-placeholder {
    width: 300px;
    height: 300px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #ff1493;
    font-size: 1.1rem;
    border: 2px dashed #ff1493;
}

.photo-placeholder small {
    display: block;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888;
}

.photo-caption {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Envelope */
.envelope-wrapper {
    cursor: pointer;
    margin: 0 auto;
    transition: transform 0.3s ease;
    display: inline-block;
}

.envelope-wrapper:hover {
    transform: scale(1.05);
}

.envelope {
    width: 200px;
    height: 140px;
    background: linear-gradient(135deg, #c9184a, #ff0f7b);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 20, 147, 0.5);
}

.envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 70px 100px 0 100px; /* 50% de altura, 50% de largura do envelope */
    border-color: #ff4d6d transparent transparent transparent;
    border-radius: 8px 8px 0 0;
    z-index: 2;
    transition: transform 0.8s ease;
    transform-origin: top;
}

.envelope.open::before {
    transform: rotateX(180deg);
}

.heart-seal {
    font-size: 3rem;
    z-index: 3;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

/* A Carta Aberta */
/* A Carta Aberta */
.letter-paper {
    background: #fff;
    color: #333;
    padding: 30px 40px;
    text-align: left;
    width: 90vw;
    max-width: 800px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px rgba(255, 20, 147, 0.4);
    border-radius: 8px;
    align-self: center;
    margin: auto;
    overflow-y: auto; /* Permite scroll se o texto for grande demais para o ecrã */
    max-height: 85vh; /* Evita que saia do slide de 100vh */
}

.letter-paper h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem; 
    color: #c9184a;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.2;
}

.letter-paper p {
    font-size: 1.15rem; 
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin-bottom: 20px;
}

.highlight-text {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 1.2rem !important; 
    color: #ff1493;
    text-align: center;
    line-height: 1.8 !important;
    margin-top: 40px;
}

.signature {
    font-family: 'Dancing Script', cursive !important;
    font-size: 2rem !important;
    color: #c9184a;
    text-align: right;
}

/* Animações Keyframes */
@keyframes heartbeat {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); text-shadow: 0 0 20px #ff1493, 0 0 40px #ff1493; }
}

@keyframes pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Responsive constraints para telemóveis */
@media (max-width: 480px) {
    .glass-card { padding: 30px 15px; width: 90%; }
    .letter-paper { padding: 30px 20px; width: 90%; }
    .time-box { padding: 10px 5px; flex: 1 1 60px; min-width: 60px; }
    .time-box span { font-size: 1.2rem; }
    .time-box p { font-size: 0.7rem; }
    .envelope { width: 160px; height: 110px; }
    .envelope::before { border-width: 55px 80px 0 80px; }
}
