@font-face {
    font-family: 'DearCamille';
    src: url('DearCamille Vector.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CsMileyaPixel';
    src: url('cs-mileya-pixel-font/CsMileyaPixelRegularDemo-4nJxp.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Font toggle control */
.font-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    gap: 6px;
}

.font-option {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #FFF8E7;
    cursor: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    opacity: 0.7;
}

.font-option:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.font-option.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

/* Sound toggle control */
.sound-toggle {
    position: fixed;
    top: 56px;
    right: 20px;
    z-index: 999;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 320px;
    justify-content: flex-end;
}

.sound-option {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #FFF8E7;
    cursor: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    opacity: 1;
}

.sound-option:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.sound-option.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

/* Mute button */
.mute-btn {
    position: fixed;
    top: 92px;
    right: 20px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #FFF8E7;
    cursor: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    opacity: 1;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

/* Audio hint */
.audio-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #FFF8E7;
    opacity: 1;
    letter-spacing: 0.1em;
    transition: opacity 0.5s ease;
    pointer-events: none;
}


/* Font variants for h1 */
header h1.font-dear-camille {
    font-family: 'DearCamille', cursive;
    font-size: 9rem;
}

header h1.font-pixelify {
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 5rem;
}

header h1.font-press-start {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.2rem;
    line-height: 1.6;
}

header h1.font-cs-mileya {
    font-family: 'CsMileyaPixel', cursive;
    font-size: 10rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    overflow: hidden;
    color: #4a4a4a;
    background: #1a1a1a;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    body {
        overflow-y: auto;
    }
}

/* Animated shifting background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('background.png') center/cover no-repeat;
    z-index: 0;
}

/* Dark overlay for legibility */
.dark-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.35);
}

/* Texture overlay */
.texture-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle 2px at 15% 25%, rgba(255, 230, 150, 0.7) 0%, transparent 100%),
        radial-gradient(circle 3px at 25% 50%, rgba(255, 220, 120, 0.5) 0%, transparent 100%),
        radial-gradient(circle 2px at 40% 15%, rgba(255, 240, 180, 0.6) 0%, transparent 100%),
        radial-gradient(circle 2px at 55% 70%, rgba(255, 200, 100, 0.4) 0%, transparent 100%),
        radial-gradient(circle 3px at 70% 30%, rgba(255, 230, 160, 0.6) 0%, transparent 100%),
        radial-gradient(circle 2px at 80% 60%, rgba(255, 210, 130, 0.5) 0%, transparent 100%),
        radial-gradient(circle 2px at 35% 75%, rgba(255, 240, 170, 0.4) 0%, transparent 100%),
        radial-gradient(circle 3px at 60% 85%, rgba(255, 220, 140, 0.5) 0%, transparent 100%),
        radial-gradient(circle 2px at 85% 20%, rgba(255, 200, 100, 0.6) 0%, transparent 100%),
        radial-gradient(circle 2px at 10% 65%, rgba(255, 230, 160, 0.4) 0%, transparent 100%),
        radial-gradient(circle 3px at 50% 40%, rgba(255, 240, 180, 0.5) 0%, transparent 100%),
        radial-gradient(circle 2px at 90% 80%, rgba(255, 210, 120, 0.4) 0%, transparent 100%);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* Page border lines */
.page-border {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.page-border::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    right: 20px;
    border-left: 1px solid rgba(255, 248, 231, 0.5);
    border-right: 1px solid rgba(255, 248, 231, 0.5);
}

.page-border::after {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 248, 231, 0.5);
    border-bottom: 1px solid rgba(255, 248, 231, 0.5);
}

/* Star cursor */
.cursor-star {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
}

.cursor-star svg {
    width: 100%;
    height: 100%;
    fill: #FFF8E7;
    stroke: #FFF6CE;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    transition: transform 0.2s ease, fill 0.2s ease;
}

.cursor-star.hovering svg {
    transform: scale(1.4) rotate(20deg);
    fill: #fff;
}

/* Glow trail */
.glow-dot {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent);
    transform: translate(-50%, -50%);
    animation: glowFade 0.8s ease-out forwards;
}

@keyframes glowFade {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
}

/* Header - left side */
header {
    position: fixed;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    text-align: left;
    z-index: 10;
    pointer-events: none;
}

header h1 {
    font-family: 'CsMileyaPixel', cursive;
    font-size: 10rem;
    font-weight: normal;
    color: #FFF8E7;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 30px rgba(255, 255, 255, 0.25);
    line-height: 0.9;
}

header .subtitle {
    font-size: 0.85rem;
    color: #FFF8E7;
    margin-top: 10px;
    letter-spacing: 0.15em;
    opacity: 1;
}

.intro-lines {
    margin-top: 45px;
    padding-left: 2.5em;
}

.intro-line {
    font-size: 1.1rem;
    color: #FFF8E7;
    margin-top: 8px;
    letter-spacing: 0.01em;
    opacity: 1;
}

.intro-line.indent-1 {
    padding-left: 70px;
}

.intro-line.indent-2 {
    padding-left: 150px;
}

/* Floating items */
.floating-items {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.floating-item {
    position: absolute;
    pointer-events: all;
    cursor: none;
    padding: 10px 20px;
    background: #ffffff;
    border: none;
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 0.85rem;
    color: #1a1a1a;
    white-space: nowrap;
    letter-spacing: 0.01em;
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, background 0.3s ease;
    animation: float var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
}

.floating-item.has-memories {
    background: #fdf6e8;
}

.floating-item:hover {
    transform: scale(1.06) translateY(-3px) rotate(0.5deg);
    box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.18);
    background: #ffffff;
    animation-play-state: paused;
}

.floating-item.has-memories:hover {
    background: #fdf6e8;
}

.floating-item.about-item {
    background: #f8e8f0;
}

.floating-item.about-item:hover {
    background: #f8e8f0;
}

.about-letter {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 0.85rem;
    color: #1a1a1a;
    line-height: 1.8;
    text-align: left;
    max-width: 380px;
    padding: 24px 28px;
    background: #ffffff;
    border-radius: 2px;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
    cursor: grab;
    position: absolute;
    overflow: visible;
}

.about-letter::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 50px;
    height: 16px;
    background: rgba(255, 230, 150, 0.6);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

.about-letter:active {
    cursor: grabbing;
}

.about-letter p {
    margin-bottom: 14px;
}

.about-letter p:last-child {
    margin-bottom: 0;
}

.about-ig {
    cursor: grab;
}

.about-ig a {
    color: #1a1a1a;
    text-decoration: none;
}

.about-gif-element {
    cursor: grab;
    width: 280px;
    height: 360px;
    position: absolute;
}

.about-gif-element .about-gif-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
}

.about-gif-frame-1 {
    animation: gifFrame1 1.6s step-end infinite;
}

.about-gif-frame-2 {
    animation: gifFrame2 1.6s step-end infinite;
}

@keyframes gifFrame1 {
    0% { opacity: 1; }
    35% { opacity: 1; }
    35.01% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes gifFrame2 {
    0% { opacity: 0; }
    35% { opacity: 0; }
    35.01% { opacity: 1; }
    100% { opacity: 1; }
}


@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(var(--rotate-start));
    }
    50% {
        transform: translateY(var(--float-distance)) rotate(var(--rotate-end));
    }
}

/* Detail view */
.detail-view {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 60px 40px;
    opacity: 1;
    transition: opacity 0.4s ease;
    overflow: auto;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    visibility: visible;
}

.detail-view::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('background.png') center/cover no-repeat;
    z-index: -1;
}

.detail-view.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Spotify embed */
.spotify-embed {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 102;
    pointer-events: all;
}

.spotify-embed:active {
    cursor: grabbing;
}

.spotify-drag-handle {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 0.7rem;
    padding: 4px 0;
    cursor: grab;
    user-select: none;
    letter-spacing: 2px;
}

.spotify-drag-handle:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.2);
}

/* Custom Spotify player */
.spotify-custom-player {
    display: none;
}

.spotify-hidden-iframe {
    display: block;
    width: 300px;
    height: 80px;
    border: none;
    border-radius: 0 0 12px 12px;
    pointer-events: all;
}

.back-btn {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 200;
    background: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 2px;
    font-family: 'Hedvig Letters Serif', serif;
    font-weight: normal;
    font-size: 0.85rem;
    color: #1a1a1a;
    cursor: none;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: 2px 3px 12px rgba(0, 0, 0, 0.18);
}

.detail-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100%;
    max-width: 1600px;
    position: relative;
    z-index: 102;
    pointer-events: none;
    padding-top: 40px;
}

.detail-content > * {
    pointer-events: all;
}

.detail-strip {
    display: inline-block;
    background: #ffffff;
    padding: 10px 24px;
    border-radius: 2px;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
}

.detail-strip.has-memories {
    background: #fdf6e8;
}

.detail-strip.about-strip {
    background: #f8e8f0;
}

.detail-content h2 {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 0.9rem;
    font-weight: normal;
    color: #1a1a1a;
}

.status-note {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 0.85rem;
    color: #1a1a1a;
    line-height: 1.5;
    font-style: normal;
    margin-top: 16px;
    background: #ffffff;
    border: none;
    border-radius: 2px;
    padding: 10px 20px;
    display: inline-block;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
    letter-spacing: 0.01em;
}

.status-note .status-label {
    font-style: normal;
    color: #1a1a1a;
}

.status-note .status-typed {
    display: inline;
    border-right: 2px solid #1a1a1a;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { border-color: #1a1a1a; }
    50% { border-color: transparent; }
}

.status-smiley {
    display: inline-block;
    animation: smileyBounce 1.5s ease-in-out infinite;
}

@keyframes smileyBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-5deg); }
    75% { transform: translateY(-1px) rotate(5deg); }
}

/* Dot star interactive element */
.dot-star {
    width: 380px;
    height: 380px;
    margin-top: 40px;
    pointer-events: all;
    touch-action: none;
}

.dot-star.hidden {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
    width: 100%;
    max-width: 1400px;
}

.media-grid img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 4/5;
}

/* Footer */
footer {
    position: fixed;
    bottom: 30px;
    left: 5%;
    text-align: left;
    z-index: 10;
    font-size: 0.75rem;
    color: #FFF8E7;
    opacity: 1;
}

footer a {
    color: #FFF8E7;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

footer .footer-link {
    text-decoration: none;
    border-bottom: 1.5px dotted rgba(255, 248, 231, 0.7);
    padding-bottom: 1px;
    position: relative;
    display: inline-block;
}

footer .footer-link:hover {
    border-bottom-color: transparent;
}

footer .footer-link svg.circle-draw {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 16px);
    height: calc(100% + 14px);
    pointer-events: none;
    overflow: visible;
}

footer .footer-link svg.circle-draw ellipse {
    fill: none;
    stroke: #FFF8E7;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.6s ease;
}

footer .footer-link:hover svg.circle-draw ellipse {
    stroke-dashoffset: 0;
}

@media (hover: none) {
    footer .footer-link svg.circle-draw {
        display: none;
    }

    footer .footer-link:hover {
        border-bottom-color: rgba(255, 248, 231, 0.7);
    }
}

footer .footer-bottom-line {
    margin-top: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

footer .footer-cta {
    margin-left: 10px;
    letter-spacing: 0.05em;
}

@media (min-width: 769px) and (max-width: 1200px) {
    .sb-element-text {
        zoom: 1.2;
    }
}

@media (min-width: 1600px) {
    .detail-view {
        padding: 60px 80px;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }

    .detail-content h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 1024px) {
    header h1 {
        font-size: 7rem;
    }

    header h1.font-cs-mileya {
        font-size: 7rem;
    }

    .intro-line {
        font-size: 1rem;
    }

    .intro-line.indent-1 {
        padding-left: 40px;
    }

    .intro-line.indent-2 {
        padding-left: 90px;
    }
}

@media (max-width: 768px) {
    header {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        padding: 24px 20px 20px;
        z-index: 10;
    }

    header h1 {
        font-size: 5.5rem;
    }

    header h1.font-cs-mileya {
        font-size: 5.5rem;
    }

    header h1.font-dear-camille {
        font-size: 6rem;
    }

    header h1.font-press-start {
        font-size: 1.4rem;
    }

    .intro-lines {
        margin-top: 25px;
        padding-left: 1em;
    }

    .intro-line {
        font-size: 1rem;
    }

    .intro-line.indent-1 {
        padding-left: 30px;
    }

    .intro-line.indent-2 {
        padding-left: 60px;
    }

    .floating-items {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 20px 20px 30px;
        margin-top: 30px;
    }

    .floating-item {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        font-size: 0.85rem;
        padding: 10px 18px;
        animation: none;
    }

    .page-border {
        display: none;
    }

    footer {
        position: relative;
        bottom: auto;
        left: auto;
        padding: 10px 20px 24px;
        font-size: 0.85rem;
    }

    .detail-content h2 {
        font-size: 0.95rem;
    }

    .back-btn {
        top: 20px;
        left: 20px;
    }

    .detail-view {
        padding: 40px 20px;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }
}

@media (hover: none), (pointer: coarse) {
    * {
        cursor: auto;
    }

    .cursor-star,
    .glow-dot {
        display: none !important;
    }

    .floating-item {
        cursor: pointer;
    }

    .back-btn,
    .sb-tool-btn,
    .sb-edit-toggle,
    .sticker-grid button,
    .sticker-picker-close {
        cursor: pointer;
    }

    .sb-element {
        cursor: auto;
    }

    .sb-element:active {
        cursor: auto;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 4rem;
    }

    header h1.font-cs-mileya {
        font-size: 4rem;
    }

    header h1.font-dear-camille {
        font-size: 4.5rem;
    }

    header h1.font-press-start {
        font-size: 1rem;
    }

    .intro-line {
        font-size: 0.9rem;
    }

    .floating-item {
        font-size: 0.78rem;
        padding: 8px 14px;
    }

    footer {
        font-size: 0.8rem;
    }

    .status-note {
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════
   SCRAPBOOK EDITOR
   ═══════════════════════════════════════════════ */

/* Edit mode toggle button */
.sb-edit-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #FFF8E7;
    cursor: none;
    transition: background 0.3s ease, border-color 0.3s ease;
    letter-spacing: 0.05em;
}

.sb-edit-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sb-edit-toggle.active {
    background: rgba(255, 200, 100, 0.3);
    border-color: rgba(255, 200, 100, 0.6);
    color: #fff;
}

/* Toolbar */
.scrapbook-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px dashed rgba(255, 248, 231, 0.4);
    border-radius: 12px;
    animation: toolbarFadeIn 0.3s ease;
}

.scrapbook-toolbar.hidden {
    display: none;
}

@keyframes toolbarFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sb-tool-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #FFF8E7;
    cursor: none;
    transition: background 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.03em;
}

.sb-tool-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.sb-save-btn {
    background: rgba(100, 200, 150, 0.2);
    border-color: rgba(100, 200, 150, 0.4);
}

.sb-save-btn:hover {
    background: rgba(100, 200, 150, 0.35);
}

/* Scrapbook Canvas */
.scrapbook-canvas {
    position: relative;
    width: 100%;
    background: transparent;
    border: none;
    transition: background 0.3s ease;
    z-index: 101;
    pointer-events: none;
    transform-origin: top center;
}

.scrapbook-canvas > * {
    pointer-events: all;
}

.scrapbook-canvas.edit-mode {
    pointer-events: all;
    border: 2px dashed rgba(255, 200, 100, 0.4);
    background: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 0 60px rgba(255, 200, 100, 0.03);
}

.scrapbook-empty {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 248, 231, 0.4);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-style: italic;
    pointer-events: none;
    z-index: 102;
}

.scrapbook-empty.hidden {
    display: none;
}

/* Scrapbook Elements */
.sb-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.2s ease;
}

.sb-element.sb-wiggle {
    animation: sbWiggle 1.2s ease-in-out 1;
}

@keyframes sbWiggle {
    0%, 100% { translate: 0 0; rotate: 0deg; }
    30% { translate: 0 -1px; rotate: -0.5deg; }
    60% { translate: 0 0.5px; rotate: 0.3deg; }
}

.sb-element:active {
    cursor: grabbing;
}

.sb-element.selected {
    outline: 2px dashed rgba(255, 200, 100, 0.8);
    outline-offset: 4px;
    z-index: 100;
}

.sb-element .sb-delete-btn {
    display: none;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: rgba(255, 80, 80, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.65rem;
    line-height: 20px;
    text-align: center;
    cursor: none;
    z-index: 200;
}

.sb-element.selected .sb-delete-btn {
    display: block;
}

/* Layer buttons */
.sb-layer-btn {
    display: none;
    position: absolute;
    top: -10px;
    padding: 2px 8px;
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 248, 231, 0.4);
    border-radius: 10px;
    color: #FFF8E7;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    cursor: pointer;
    z-index: 200;
    white-space: nowrap;
}

.sb-to-front {
    right: 30px;
}

.sb-to-back {
    right: 80px;
}

.sb-layer-btn:hover {
    background: rgba(60, 60, 60, 0.95);
}

.sb-element.selected .sb-layer-btn {
    display: block;
}

/* Resize handle */
.sb-element .sb-resize-handle {
    display: none;
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    background: rgba(255, 200, 100, 0.8);
    border-radius: 3px;
    cursor: none;
    z-index: 200;
}

.sb-element.selected .sb-resize-handle {
    display: block;
}

/* Rotate handle */
.sb-element .sb-rotate-handle {
    display: none;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: rgba(150, 200, 255, 0.8);
    border-radius: 50%;
    cursor: none;
    z-index: 200;
    font-size: 0.5rem;
    line-height: 16px;
    text-align: center;
}

.sb-element.selected .sb-rotate-handle {
    display: block;
}

/* Photo elements with tape decoration */
.sb-element-image {
    padding: 6px;
    background: #fff;
    box-shadow: 2px 3px 12px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sb-element-image.no-border {
    padding: 0;
    background: transparent;
    box-shadow: 2px 3px 12px rgba(0, 0, 0, 0.25);
}

.sb-element-image::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 40px;
    height: 16px;
    background: rgba(255, 230, 150, 0.6);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

.sb-element-image.no-tape::before {
    display: none;
}

.sb-element-image img,
.sb-element-image video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
    background: rgba(200, 200, 200, 0.15);
    min-height: 80px;
}

/* Image option buttons (border/tape/crop) */
.sb-image-options {
    display: none;
    position: absolute;
    bottom: -30px;
    left: 0;
    gap: 4px;
    z-index: 200;
}

.sb-element.selected .sb-image-options {
    display: flex;
}

.sb-img-opt-btn {
    padding: 2px 8px;
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 248, 231, 0.4);
    border-radius: 10px;
    color: #FFF8E7;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.sb-img-opt-btn:hover {
    background: rgba(60, 60, 60, 0.95);
}

.sb-img-opt-btn.active {
    background: rgba(255, 200, 100, 0.3);
    border-color: rgba(255, 200, 100, 0.6);
}

/* Crop overlay */
.sb-crop-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    cursor: crosshair;
}

.sb-crop-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.sb-crop-selection {
    position: absolute;
    border: 2px dashed rgba(255, 200, 100, 0.9);
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.sb-crop-actions {
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 200;
}

.sb-crop-confirm, .sb-crop-cancel {
    padding: 4px 12px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sb-crop-confirm {
    background: rgba(100, 200, 150, 0.4);
    color: #fff;
}

.sb-crop-cancel {
    background: rgba(255, 80, 80, 0.4);
    color: #fff;
}


/* Text elements */
.sb-element-text {
    padding: 10px 20px;
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    white-space: pre-wrap;
    min-width: 60px;
    min-height: 24px;
    border-radius: 2px;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.12);
}

.sb-element-text .sb-text-content[contenteditable="true"] {
    outline: 1px dashed rgba(255, 248, 231, 0.5);
    outline-offset: 3px;
    cursor: text;
}

/* Sticker elements */
.sb-element-sticker {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.3));
}

/* Audio elements */
.sb-element-audio {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.sb-element-audio .sb-audio-icon {
    font-size: 1.2rem;
}

.sb-element-audio .sb-audio-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #FFF8E7;
    opacity: 0.8;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-element-audio audio {
    display: none;
}

.sb-element-audio.playing {
    border-color: rgba(100, 200, 255, 0.5);
    box-shadow: 0 0 12px rgba(100, 200, 255, 0.2);
}

/* Swirl elements */
.sb-element-swirl {
    border-radius: 50%;
    overflow: visible;
    pointer-events: all;
}

.sb-swirl-canvas {
    display: block;
    border-radius: 50%;
}

/* Sticker Picker Modal */
.sticker-picker {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sticker-picker.hidden {
    display: none;
}

.sticker-picker-inner {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
}

.sticker-picker-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #FFF8E7;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.sticker-grid button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1.6rem;
    padding: 8px;
    cursor: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sticker-grid button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

.sticker-picker-close {
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #FFF8E7;
    cursor: none;
}

.sticker-picker-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* JSON export toast */
.sb-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(100, 200, 150, 0.4);
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #FFF8E7;
    z-index: 9000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive scrapbook */
@media (max-width: 768px) {
    .scrapbook-canvas {
        position: relative;
        inset: auto;
        width: 100% !important;
        height: auto !important;
        overflow: visible;
        z-index: 10;
        pointer-events: all;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 80px 20px 100px;
        transform: none !important;
        flex-shrink: 0;
    }

    .scrapbook-canvas.edit-mode {
        border: none;
        background: transparent;
    }

    .sb-element {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 90% !important;
        max-width: 350px;
    }

    .sb-element-image {
        width: 100% !important;
        position: relative !important;
        overflow: visible;
    }

    .sb-element-image img,
    .sb-element-image video {
        width: 100%;
        height: auto !important;
        object-fit: contain;
        min-height: 0;
    }

    .about-gif-element {
        height: 400px;
        max-width: 300px;
    }

    .about-gif-element .about-gif-frame {
        height: 100% !important;
        object-fit: cover;
    }

    /* Hide standalone text elements on mobile (they become overlays) */
    .sb-element-text.mobile-hidden {
        display: none !important;
    }

    /* Text overlay annotations on images */
    .sb-text-overlay {
        position: absolute;
        z-index: 10;
        padding: 4px 10px;
        background: rgba(255, 255, 255, 0.92);
        color: #1a1a1a;
        font-family: 'Hedvig Letters Serif', serif;
        letter-spacing: 0.01em;
        white-space: pre-wrap;
        border-radius: 2px;
        box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.15);
        pointer-events: none;
        max-width: 70%;
        line-height: 1.3;
    }

    .sb-element-text {
        width: auto !important;
        max-width: 100%;
    }

    .sb-element-sticker {
        width: auto !important;
    }

    .spotify-embed {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100%;
        max-width: 300px;
        order: var(--spotify-mobile-order, 999);
    }

    .scrapbook-toolbar {
        gap: 6px;
        padding: 8px 12px;
    }

    .sb-tool-btn {
        font-size: 0.65rem;
        padding: 5px 10px;
    }

    .sb-edit-toggle {
        bottom: 20px;
        right: 20px;
    }

    .detail-view {
        position: fixed;
        inset: 0;
        display: block;
        overflow-x: hidden;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        padding: 60px 20px 80px;
    }

    .detail-content {
        padding-top: 10px;
        overflow: visible;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

}

