:root
{
    --bg-pink: #f5d6e3;
    --bg-pink-2: #efc7d8;
    --grid: rgba(111, 111, 121, 0.16);
    --text-main: rgb(75, 49, 69);
    --text-soft: rgb(113, 85, 104);
    --paper: #fff8fb;
    --paper-2: #fff5ea;
    --sticky: #ffe99a;
    --lavender: #dbc8f7;
    --modal-overlay: rgba(44, 30, 52, 0.42);
    --shadow-soft: rgba(95, 66, 92, 0.14);
    --shadow-deep: rgba(95, 66, 92, 0.20);
    --tape: rgba(245, 236, 255, 0.84);
}

*
{
    box-sizing: border-box;
}

html,
body
{
    margin: 0;
    min-height: 100%;
}

body
{
    font-family: "Inria Serif", serif;
    color: var(--text-main);
    background:
        linear-gradient(to right, var(--grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
        linear-gradient(180deg, var(--bg-pink), var(--bg-pink-2));
    background-size: 42px 42px, 42px 42px, 100% 100%;
    overflow: hidden;
}

.workspace-header
{
    position: relative;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px 10px;
}

.back-link
{
    text-decoration: none;
    color: var(--text-main);
    font-family: "Mogra", serif;
    background: rgba(255, 250, 253, 0.82);
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(98, 72, 101, 0.08);
    white-space: nowrap;
}

.workspace-heading h1
{
    margin: 0;
    font-family: "Limelight", serif;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1;
}

.workspace-heading p
{
    margin: 8px 0 0;
    font-family: "Mogra", serif;
    color: var(--text-soft);
}

.workspace-viewport
{
    position: relative;
    width: 100vw;
    height: calc(100vh - 100px);
    overflow: hidden;
    cursor: grab;
}

.workspace-viewport.dragging
{
    cursor: grabbing;
}

.workspace-board
{
    position: absolute;
    left: 0;
    top: 0;
    width: 2600px;
    height: 1800px;
    transform: translate(0px, 0px);
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 28%);
}

/* scrapss */

.scrap-piece
{
    position: absolute;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, filter 0.18s ease;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
}

.scrap-piece:hover
{
    filter: drop-shadow(0 16px 20px var(--shadow-deep));
}

.scrap-piece.dragging-piece
{
    cursor: grabbing;
}

.scrap-piece img
{
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-piece
{
    position: absolute;
}

.photo-piece img
{
    border: 10px solid #fff;
    border-bottom: 18px solid #fff;
    border-radius: 1px;
    box-shadow:
        0 14px 22px var(--shadow-deep),
        0 2px 4px rgba(70, 50, 70, 0.08);
    filter: contrast(1.01) saturate(0.98);
    background: #fff;
}

/* subtle paper feel */
.photo-piece::after
{
    content: "";
    position: absolute;
    inset: 10px 10px 18px 10px;
    background:
        linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
        radial-gradient(circle at top left, rgba(255,255,255,0.10), transparent 46%);
    mix-blend-mode: screen;
    pointer-events: none;
}

/* tape templates */
.tape-single::before
{
    content: "";
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 84px;
    height: 26px;
    border-radius: 6px;
    background: var(--tape);
    box-shadow: 0 3px 8px rgba(95, 66, 92, 0.08);
    pointer-events: none;
}

.tape-corners::before,
.tape-corners::after
{
    content: "";
    position: absolute;
    top: -10px;
    width: 64px;
    height: 22px;
    border-radius: 6px;
    background: var(--tape);
    box-shadow: 0 3px 8px rgba(95, 66, 92, 0.08);
    pointer-events: none;
}

.tape-corners::before
{
    left: 16px;
    transform: rotate(-18deg);
}

.tape-corners::after
{
    right: 16px;
    transform: rotate(16deg);
}

.tape-bottom::before
{
    content: "";
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) rotate(1deg);
    width: 110px;
    height: 22px;
    border-radius: 6px;
    background: var(--tape);
    box-shadow: 0 3px 8px rgba(95, 66, 92, 0.08);
    pointer-events: none;
}

.scrap-label
{
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--lavender);
    font-family: "Mogra", serif;
    font-size: 0.82rem;
    color: var(--text-main);
    box-shadow: 0 6px 12px rgba(95, 66, 92, 0.08);
}

/* sticky note */
.sticky-note .note-inner
{
    position: relative;
    background: var(--sticky);
    padding: 18px 18px 20px;
    border-radius: 2px;
    min-height: 170px;
    box-shadow:
        0 14px 24px rgba(95, 66, 92, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.30);
}

.sticky-note .note-inner::before
{
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(255,255,255,0.50), rgba(231, 205, 88, 0.55));
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.sticky-note .note-inner h3
{
    margin: 0 0 10px;
    font-family: "Mogra", serif;
    font-size: 1rem;
}

.sticky-note .note-inner p
{
    margin: 0;
    font-family: "Mogra", serif;
    line-height: 1.55;
}

/* stickers */
.board-sticker
{
    position: absolute;
    padding: 9px 15px;
    border-radius: 999px;
    font-family: "Mogra", serif;
    font-size: 0.86rem;
    background: rgba(255, 248, 251, 0.9);
    color: var(--text-main);
    box-shadow: 0 8px 16px rgba(95, 66, 92, 0.08);
}

.sticker-1
{
    left: 520px;
    top: 300px;
    transform: rotate(-6deg);
}

.sticker-2
{
    left: 1520px;
    top: 880px;
    transform: rotate(7deg);
}

.sticker-3
{
    left: 1390px;
    top: 520px;
    transform: rotate(-4deg);
}

/* modal */
.post-modal
{
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
}

.post-modal.hidden
{
    display: none;
}

.post-modal-box
{
    position: relative;
    width: min(760px, 92vw);
    max-height: 84vh;
    overflow-y: auto;
    padding: 28px;
    border-radius: 28px;
    background: var(--paper);
    box-shadow: 0 24px 40px rgba(28, 18, 34, 0.22);
}

.post-modal-close
{
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: var(--lavender);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

#postModalContent h2
{
    margin: 0 0 8px;
    font-family: "Italiana", serif;
    font-size: 2rem;
}

.post-date
{
    margin: 0 0 18px;
    color: var(--text-soft);
    font-family: "Mogra", serif;
    font-size: 0.9rem;
}

#postModalContent p
{
    line-height: 1.75;
    margin-bottom: 14px;
}

.hidden-storage
{
    display: none;
}

/* MOBILE: long scrapbook board */
@media (max-width: 900px)
{
    body
    {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .workspace-header
    {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 16px 12px;
    }

    .workspace-heading h1
    {
        font-size: clamp(1.8rem, 7vw, 2.6rem);
    }

    .workspace-viewport
    {
        width: 100%;
        height: auto;
        overflow: visible;
        cursor: default;
        padding: 0 14px 28px;
    }

    .workspace-board
    {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        height: auto;
        min-height: 0;
        transform: none !important;
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 8px 0 24px;
        background:
            radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 28%),
            radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 28%);
    }

    .scrap-piece
    {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100%;
        transform: none !important;
    }

    .photo-piece img
    {
        border: 8px solid #fff;
        border-bottom: 14px solid #fff;
    }

    .sticky-note .note-inner
    {
        min-height: unset;
    }

    .board-sticker
    {
        position: relative;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: fit-content;
        max-width: 100%;
        margin: 2px 0;
    }
}