/* ── Reset ────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    height: 100dvh;
}

body {
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0 40px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 58% 64% at -10% 52%, rgba(168, 85, 247, 0.15), transparent 70%),
        radial-gradient(ellipse 60% 66% at 110% 48%, rgba(236, 72, 153, 0.14), transparent 72%),
        radial-gradient(circle at 18% 22%, rgba(34, 211, 238, 0.08), transparent 42%),
        radial-gradient(circle at 82% 26%, rgba(139, 92, 246, 0.07), transparent 44%),
        linear-gradient(180deg, #0f0a15 0%, #0a0510 45%, #050208 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Source Sans 3', sans-serif;
    position: relative;
    touch-action: none;
}

/* ── Background Ambience ──────────────────────────────────── */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 42% 58% at 2% 50%, rgba(168, 85, 247, 0.08), transparent 76%),
        radial-gradient(ellipse 42% 58% at 98% 50%, rgba(236, 72, 153, 0.08), transparent 76%);
}

/* ── iPod Container ───────────────────────────────────────── */

#ipod-container {
    position: relative;
    z-index: 1;
    --base-width: min(calc(100vw - 80px), calc((100dvh - 120px) * 0.5955));
    width: var(--base-width);
    flex-shrink: 0;
    display: block;
}

#ipod-component {
    display: block;
    width: 100%;
}

body.dev-chrome-hidden {
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
}

body.dev-chrome-hidden .label-corner {
    display: none;
}

body.dev-chrome-hidden #ipod-container {
    --base-width: min(calc(100vw - 80px), calc((100dvh - 320px) * 0.5955));
}

body.app-loading #ipod-container {
    visibility: hidden;
}

#app-shell-loader {
    position: absolute;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.24s ease;
}

#app-shell-loader.is-hidden {
    opacity: 0;
}

body.app-loading #app-shell-loader {
    display: flex;
}

.ipod-loader-box {
    border: 1px solid rgba(236, 72, 153, 0.45);
    border-radius: 10px;
    background: rgba(15, 10, 21, 0.92);
    box-shadow: 
        0 14px 36px rgba(0, 0, 0, 0.45),
        0 0 20px rgba(236, 72, 153, 0.2);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ipod-loader-spinner {
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    border: 2px solid rgba(168, 85, 247, 0.28);
    border-top-color: rgba(236, 72, 153, 1);
    animation: ipodLoaderSpin 0.9s linear infinite;
}

.ipod-loader-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #ec48a6;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}

@keyframes ipodLoaderSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#ipod {
    position: relative;
    z-index: 1;
    width: var(--base-width);
    height: calc(var(--base-width) / 0.5955);
    flex-shrink: 0;
    display: block;
    --u: calc(var(--base-width) / 371);
}

/* ── DoodleDev Shell Primitives ───────────────────────────── */

.item {
    position: absolute;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.item.interactive {
    pointer-events: auto;
    cursor: pointer;
    touch-action: none;
    transition: transform 0.05s ease-in-out, filter 0.05s ease-in-out;
    will-change: transform;
}

.item.interactive.pressed {
    transform: scale(0.98) !important;
}

.shape {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: auto;
}

/* ── Desktop Corner Labels ─────────────────────────────────── */

.label-corner {
    position: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(236, 72, 153, 0.85);
    user-select: none;
    z-index: 100;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.label-top-left {
    top: 24px;
    left: 24px;
}

.label-top-right {
    top: 24px;
    right: 24px;
    text-align: right;
}

.label-bottom-left {
    bottom: 24px;
    left: 24px;
}

.label-bottom-right {
    bottom: 24px;
    right: 24px;
    text-align: right;
}

.label-corner a {
    color: rgba(52, 211, 238, 0.85);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.4s ease;
    text-shadow: 0 0 8px rgba(52, 211, 238, 0.3);
}

.label-corner a:hover {
    color: rgba(52, 211, 238, 1);
    text-shadow: 0 0 12px rgba(52, 211, 238, 0.6);
}

@media (max-width: 600px) {
    body {
        padding: 0 10px;
        justify-content: center;
    }

    .label-corner {
        font-size: 10px;
        letter-spacing: 0.12em;
        line-height: 1.2;
    }

    .label-top-left,
    .label-top-right {
        top: 14px;
    }

    .label-top-left,
    .label-bottom-left {
        left: 14px;
    }

    .label-top-right,
    .label-bottom-right {
        right: 14px;
    }

    .label-bottom-left,
    .label-bottom-right {
        bottom: 14px;
    }

    #ipod-container {
        --base-width: min(calc(100vw - 20px), calc((100dvh - 120px) * 0.5955));
    }

    body.dev-chrome-hidden #ipod-container {
        --base-width: min(calc(100vw - 20px), calc((100dvh - 240px) * 0.5955));
    }
}