:root {
    --cream: #fdfcf0;
    --faded-pink: #e6b8af;
    --dusty-blue: #b2c2d1;
    --muted-beige: #d9cfc1;
    --charcoal: #333333;
    --paper-white: #ffffff;
    --sage-green: #789741;
    --tape-color: rgba(240, 230, 140, 0.4);
    --main-font: 'Playpen Sans', 'Roboto', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;

    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */

}

.prevent-select {
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

body {
    background-color: var(--sage-green);
    color: var(--cream);
    font-family: var(--main-font);
    overflow: hidden; /* Prevent default scrolling to handle snapping via container */
}

/* Typography fallbacks for handmade feel */
.handwritten {
    font-family: var(--main-font);
}

/* Film Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0); }
    70% { transform: translate(0, 10%); }
    80% { transform: translate(-15%, 0); }
    90% { transform: translate(10%, 5%); }
}

/* Scroll Container */
.scrapbook-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Page Defaults */
.page {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--sage-green);
}

.content-wrapper {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

/* Layout Components */
.polaroid {
    background: var(--paper-white);
    padding: 10px 10px 30px 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 250px;
    position: relative;
}

.polaroid.small {
    width: fit-content;
    padding: 6px 6px 20px 6px;
}

.polaroid.small .photo-placeholder, .polaroid.small .photo {
    margin-bottom: 8px;
}

.polaroid.small .caption {
    font-size: 0.7rem;
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: #eee;
    margin-bottom: 15px;
}

.photo {
    width: 100%;
    aspect-ratio: 3/4;
    background: #eee;
    margin-bottom: 15px;
}

.photo.small {
    width: 180px;
    aspect-ratio: 1/1;
}

.photo-placeholder.small {
    width: 120px;
}

.caption {
    font-size: 0.9rem;
    color: #666;
}

.tape {
    width: 80px;
    height: 30px;
    background: var(--tape-color);
    position: absolute;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tape.top-right { top: -15px; right: -20px; transform: rotate(45deg); }
.tape.top-left { top: -15px; left: -20px; transform: rotate(-45deg); }

.paper-scrap {
    background: var(--paper-white);
    padding: 5px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
    position: relative;
    /* max-width: 80%; */
    margin-bottom: 20px;
    border-radius: 2px;
    color: var(--charcoal);
}

/* Torn paper effect using clip-path */
.paper-scrap::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--paper-white);
    clip-path: polygon(0% 0%, 5% 100%, 10% 0%, 15% 100%, 20% 0%, 25% 100%, 30% 0%, 35% 100%, 40% 0%, 45% 100%, 50% 0%, 55% 100%, 60% 0%, 65% 100%, 70% 0%, 75% 100%, 80% 0%, 85% 100%, 90% 0%, 95% 100%, 100% 0%);
}

/* Page Specific Styles */
.intro h1 { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.8; }
.intro .subtitle { font-size: 0.5rem; color: var(--cream); letter-spacing: 2px; }

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    opacity: 0.4;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
    40% {transform: translateY(-10px) translateX(-50%);}
    60% {transform: translateY(-5px) translateX(-50%);}
}

.breathing-space { background-color: #ffbbbb; }
.quiet-text { font-style: italic; opacity: 0.6; font-size: 1.2rem; color: var(--charcoal);}

.collage-item { position: absolute; box-shadow: 2px 2px 10px rgba(0,0,0,0.05); background-color: var(--muted-beige);}

.vinyl-container { text-align: center; }
.vinyl {
    width: 200px;
    height: 200px;
    background: #222;
    border-radius: 50%;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: rotate 10s linear infinite;
}

.vinyl::before {
    content: '';
    width: 90%;
    height: 90%;
    border: 1px solid #333;
    border-radius: 50%;
    position: absolute;
}

.vinyl .label {
    width: 60px;
    height: 60px;
    background: var(--dusty-blue);
    border-radius: 50%;
    z-index: 2;
}

@keyframes rotate { from {transform: rotate(0deg);} to {transform: rotate(360deg);} }

.sticker {
    font-size: 3rem;
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: transform 0.3s;
}

.sticker:active { transform: scale(0.9); }

.tooltip {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
    white-space: nowrap;
}

.hidden-message {
    margin-top: 30px;
    opacity: 0;
    transition: opacity 1s;
    font-size: 1.2rem;
}

.hidden-message.show { opacity: 0.8; }

.big-text { font-size: 2rem; line-height: 1.4; opacity: 0.7; }

/* Flip Card */
.flip-card-container {
    perspective: 1000px;
    width: 250px;
    height: 320px;
}

.flip-card-container.small {
    width: 280px;
    height: 180px;
    margin-bottom: 20px;
}

.lyrics-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80%;
    width: 100%;
}

.lyric-scrap {
    background-color: var(--paper-white);
    height: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.2rem;
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    flex-direction: column;
}

.info-scrap {
    background-color: var(--dusty-blue);
    max-height: fit-content;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.info-scrap::before {
    background-color: var(--dusty-blue);
}

.song-name {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.artist-name {
    font-size: 1rem;
    opacity: 0.8;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card {
    height: 100%;
}

.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }

.flip-card-front, .flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flip-card .paper-scrap {
    margin-bottom: 0;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Interactive feedback */
.interactable { cursor: pointer; }

/* Floating animation for objects */
.floating { animation: floating 4s ease-in-out infinite; }
@keyframes floating {
    0% { transform: translate(0, 0px); }
    50% { transform: translate(0, 8px); }
    100% { transform: translate(0, -0px); }
}

/* Small Doodle */
.small-doodle {
    margin-top: 20px;
    font-size: 1.5rem;
    opacity: 0.3;
}

.message {
    width: 100%;
    border-radius: 10px;
}

.music-page {
    flex-direction: column;
    justify-content: space-around;
}

/* Music Toggle Button */
.music-control {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--cream);
    transition: transform 0.3s, background 0.3s;
    padding: 8px;
}

.music-control:active {
    transform: scale(0.9);
}

.music-control svg {
    width: 100%;
    height: 100%;
}

.music-control .hidden {
    display: none;
}


/* Polaroid Back Specifics */
.flip-card-back .paper-scrap {
    width: 140px;
    height: 180px;
    padding: 15px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Page Specific Styles */

.music-page, .message-page {
    flex-direction: column;
}