html,
body,
#viewDiv,
#container {
   padding: 0;
   margin: 0;
   height: 100%;
   width: 100%;
   font-family: "Montserrat", sans-serif;
}

body {
    background: radial-gradient(#5dbcd2, #f4f4f4);
}

#viewDiv canvas {
    filter: saturate(1.2) drop-shadow(0 0 20px white);
}
.memoryModal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 20, 0.88);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.memoryModal[hidden] {
    display: none;
}

.memoryCard {
    position: relative;
    display: flex;
    width: min(1200px, 100%);
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: memoryIn 0.25s ease-out;
}

@keyframes memoryIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.memoryPhotoWrap {
    flex: 1 1 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0d16;
    min-width: 0;
}

.memoryPhotoWrap img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    object-fit: contain;
}

.memoryBody {
    flex: 1 1 40%;
    padding: 40px 36px;
    overflow-y: auto;
    color: #2b2b3a;
}

.memoryBody h2 {
    margin: 0 0 12px;
    font-size: 1.8em;
    line-height: 1.2;
}

.memoryDates {
    margin: 0 0 20px;
    color: #7a7a8c;
    font-size: 0.95em;
}

.memoryFact {
    margin: 0 0 24px;
    padding: 14px 16px;
    background: #fff0f3;
    border-left: 4px solid #e63957;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1em;
}

.memoryModal svg {
    width: 1.2em;
    height: 1.2em;
    flex: none;
    vertical-align: -0.2em;
}

.memoryDates,
.memoryFact {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.memoryFact svg {
    color: #e63957;
    fill: #e63957;
}

.memoryClose {
    display: flex;
    align-items: center;
    justify-content: center;
}

.memoryClose svg {
    width: 22px;
    height: 22px;
}

.memoryText {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.7;
}

.memoryClose {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.memoryClose:hover {
    background: rgba(0, 0, 0, 0.8);
}

.introCard {
    width: min(560px, 100%);
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    animation: memoryIn 0.25s ease-out;
}

.introCard h2 {
    margin: 0 0 20px;
    font-size: 1.8em;
    line-height: 1.2;
}

.introCard p {
    margin: 0 0 16px;
    font-size: 1.05em;
    line-height: 1.7;
}

.introButton:hover {
    background: #cf2a47;
}

@media (max-width: 800px) {
    .memoryModal {
        padding: 0;
        align-items: stretch;
    }

    .memoryCard {
        flex-direction: column;
        max-height: none;
        min-height: 100%;
        border-radius: 0;
    }

    .memoryPhotoWrap img {
        max-height: 60vh;
    }

    .memoryBody {
        padding: 24px 20px 32px;
        overflow-y: visible;
    }
}