/* Base layout */
html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: #0f0f12;
    color: #f3f3f3;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.stage {
    position: relative;
    width: 100%;
    height: 100vh; /* lock to viewport */
    overflow: hidden; /* do not let children exceed visually */
    touch-action: none; /* allow custom gestures */
}

/* Spawn button */
.spawn-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #1f1f25;
    color: #fff;
    font-size: 28px;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    transition: transform 120ms ease, background 180ms ease;
}

.spawn-btn:hover { transform: scale(1.06); }
.spawn-btn:active { transform: scale(0.96); }

/* List button */
.list-btn {
    position: fixed;
    right: 16px;
    bottom: 84px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: none;
    background: #1f1f25;
    color: #fff;
    font-size: 20px;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    transition: transform 120ms ease, background 180ms ease;
}
.row-btn {
    position: fixed;
    right: 16px;
    bottom: 152px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: none;
    background: #1f1f25;
    color: #fff;
    font-size: 20px;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    transition: transform 120ms ease, background 180ms ease;
}

.row-btn:hover { transform: scale(1.06); }
.row-btn:active { transform: scale(0.96); }
.row-btn.active { background: #2a2a33; }

.list-btn:hover { transform: scale(1.06); }
.list-btn:active { transform: scale(0.96); }
.list-btn.active { background: #2a2a33; }

/* Draggable containers */
.container {
    position: absolute;
    inset: 0 auto auto 0; /* establish top/left */
    width: min(86vw, 520px);
    min-width: 240px;
    height: min(56vh, 380px);
    min-height: 160px;
    border-radius: 18px;
    background: var(--bg, linear-gradient(to right, #ffd6e0, #fff0f5));
    box-shadow:
        0 10px 24px rgba(0,0,0,0.25),
        inset 0 0 0 1px rgba(255,255,255,0.15);
    user-select: none;
    cursor: grab;
    transform-origin: 50% 50%;
    opacity: 0;
    transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(0.98);
    transition: transform 480ms cubic-bezier(.22,.61,.36,1), opacity 480ms cubic-bezier(.22,.61,.36,1);
    will-change: transform, opacity;
}

.container.dragging {
    cursor: grabbing;
    transition: none; /* snappy drag */
}

.container .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-weight: 600;
    color: rgba(0,0,0,0.65);
}

.container .content {
    padding: 12px;
    color: #ffffff;
}

.close-btn {
    appearance: none;
    border: none;
    background: rgba(255,255,255,0.55);
    color: #222;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 0;
    cursor: pointer;
}

/* Enter/exit helpers */
.container.enter { opacity: 1; transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(1); }

.container.exit { opacity: 0; transform: translate3d(var(--x, 0px), var(--y, 30px), 0) scale(0.96); }

/* Mobile tweaks */
@media (max-width: 640px) {
    .container {
        width: calc(100vw - 24px);
        height: min(60vh, 420px);
        border-radius: 16px;
    }
    .spawn-btn {
        width: 64px;
        height: 64px;
        right: 12px;
        bottom: 12px;
        font-size: 30px;
    }
    .list-btn {
        width: 56px;
        height: 56px;
        right: 12px;
        bottom: 88px;
        font-size: 18px;
    }
    .row-btn {
        width: 56px;
        height: 56px;
        right: 12px;
        bottom: 156px;
        font-size: 18px;
    }
}

.container{
    width: 30%;
    height: 154px;
    background: linear-gradient(to right, #e4cbff, #9fffc4);
    border-radius: 40px;
}

.container h1{
    color: #fff;
    text-align: center;
    user-select: none;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: 20px;
    margin-right: 20px;
}

.container p{
    color: #fff;
    text-align: center;
    user-select: none;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
}

body {
    background-color: #ffd7a6;
}