/* Playground — single-viewport draggable mood board (no scroll) */

html:has(body.is-playground-page),
body.is-playground-page {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body.is-playground-page {
    max-width: 100vw;
}

#app-root.app-root-playground {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.app-root-playground .content-wrapper-fullwidth,
.app-root-playground .right-panel-fullwidth,
.app-root-playground .right-panel-fullwidth .scroll-area,
.app-root-playground .single-page-wrapper {
    height: 100%;
    min-height: 0;
    flex: none;
    overflow: hidden;
    display: block;
}

.playground-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    /* Graph-paper grid backdrop */
    background-color: #fcfcfc;
    background-image:
        linear-gradient(to right, rgba(17, 17, 17, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 17, 17, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    overflow: hidden;
}

.playground-board-shell {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.playground-board-header {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.playground-board-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
    color: rgba(17, 17, 17, 0.34);
    font-size: 1.15rem;
}

.playground-board-header__icon i:last-child {
    transform: translate(-6px, 3px) scale(0.92);
    opacity: 0.72;
}

.playground-board-header__title {
    margin: 0 0 10px;
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(1.7rem, 3.6vw, 2.6rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #111111;
}

.playground-board-header__subtitle {
    margin: 0;
    font-size: clamp(0.82rem, 2vw, 0.92rem);
    line-height: 1.5;
    color: rgba(17, 17, 17, 0.42);
}

.playground-board-header__hint {
    margin: 14px 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.28);
}

.playground-board {
    position: absolute;
    inset: 0;
    min-height: 0;
    height: 100%;
    border-radius: 0;
    overflow: visible;
    touch-action: none;
}

.playground-item {
    position: absolute;
    left: var(--pg-x, 10%);
    top: var(--pg-y, 8%);
    z-index: var(--pg-z, 1);
    width: min(var(--pg-width, auto), 17vw);
    max-width: min(var(--pg-width, 280px), calc(100vw - 32px));
    transform: rotate(var(--pg-rotate, 0deg));
    transform-origin: center center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.playground-item.is-dragging {
    cursor: grabbing;
    z-index: 200 !important;
    filter: drop-shadow(0 16px 28px rgba(17, 17, 17, 0.18));
}

.playground-item--project {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.playground-item--linked .playground-item__media {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.playground-item--linked:not(.is-dragging):hover .playground-item__media {
    transform: scale(1.02);
    filter: drop-shadow(0 8px 16px rgba(17, 17, 17, 0.12));
}

.playground-item--linked:not(.is-dragging):hover .playground-item__caption {
    color: rgba(17, 17, 17, 0.72);
}

.playground-item__media {
    background: transparent;
    padding: 0;
    border-radius: 6px;
}

.playground-item__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    pointer-events: none;
}

.playground-item__caption {
    margin: 0;
    padding: 0 4px;
    width: 100%;
    font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
    font-size: clamp(0.72rem, 1.2vw, 0.88rem);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: 0.01em;
    text-align: center;
    color: #1a1a1a;
    pointer-events: none;
}

.playground-item--no-caption {
    gap: 0;
}

.playground-item--note {
    width: min(var(--pg-width, 160px), 14vw, calc(100vw - 48px));
    padding: 14px 12px;
    background: #f4e58d;
    border-radius: 2px;
    box-shadow:
        1px 2px 0 rgba(0, 0, 0, 0.05),
        0 8px 18px rgba(17, 17, 17, 0.08);
}

.playground-item--award-note {
    z-index: calc(var(--pg-z, 1) + 1);
    overflow: visible;
}

.playground-award-arrow {
    position: absolute;
    color: rgba(17, 17, 17, 0.38);
    pointer-events: none;
    overflow: visible;
}

.playground-award-arrow--enchanter {
    right: -46px;
    bottom: 2px;
    width: 58px;
    height: 34px;
    transform: rotate(6deg);
}

.playground-award-arrow--dailymoo {
    right: -50px;
    bottom: 6px;
    width: 62px;
    height: 36px;
    transform: rotate(4deg);
}

.playground-item--note p {
    margin: 0;
    position: relative;
    z-index: 1;
    font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
    font-size: clamp(0.78rem, 1.5vw, 0.92rem);
    line-height: 1.35;
    color: rgba(17, 17, 17, 0.72);
}

.app-root-playground .content-wrapper-fullwidth,
.app-root-playground .right-panel-fullwidth {
    width: 100%;
    max-width: none;
}

@media (max-width: 900px) {
    .playground-item {
        width: min(var(--pg-width, auto), 28vw);
    }

    .playground-item--note {
        width: min(var(--pg-width, 140px), 26vw, calc(100vw - 40px));
    }

    .playground-board-header__hint {
        margin-top: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .playground-item {
        transition: none;
    }
}
