:root {
    --nav-h: 120px;
    --nav-padding: 12px;
    --player-max-w: 900px;
    --player-width-clamp: 92vw;
    --bg: #0f1113;
    --muted: #bfc7d1;
    --case-w: 120px;
    --case-h: 160px;
    --case-border: #2a2a33;
    --case-spine: #141418;
    --case-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, system-ui, Segoe UI, Roboto, 'Helvetica Neue', Arial;
    color: var(--muted);
    background-image: url("corepattern.png");
    background-repeat: repeat;
    background-size: 20%;
}

.nav {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nav-padding);
    position: relative;
    box-sizing: border-box;
}

#time {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    z-index: 20;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
#time {
    font-family: "DS-Digital", "Orbitron", "Courier New", monospace;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 1.5px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #ff8a00;
    display: inline-block;
    text-shadow: 0 0 6px rgba(255, 138, 0, 0.85), 0 0 12px rgba(255, 138, 0, 0.4), 0 1px 0 rgba(0, 0, 0, 0.6);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    pointer-events: none;
    z-index: 20;
}

#time.small {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 5px;
    letter-spacing: 1px;
}

#time.glow {
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% {
        text-shadow: 0 0 4px rgba(255, 138, 0, 0.7), 0 0 10px rgba(255, 138, 0, 0.35);
    }
    50% {
        text-shadow: 0 0 8px rgba(255, 170, 40, 0.95), 0 0 18px rgba(255, 150, 50, 0.55);
    }
    100% {
        text-shadow: 0 0 4px rgba(255, 138, 0, 0.7), 0 0 10px rgba(255, 138, 0, 0.35);
    }
}

.dvd-player {
    width: 100%;
    height: 100%;
    position: absolute;
    user-select: none;
    cursor: pointer;
    display: block;
}

.dvd-player img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 8px;
    box-shadow: var(--case-shadow);
}

.dvd-target {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.player-loading {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity .22s
}

.player-loading.show {
    opacity: 1
}

.wrap {
    display: flex;
    gap: 18px;
    padding: 18px;
    box-sizing: border-box;
}

.main {
    flex: 1;
    min-height: calc(100vh - var(--nav-h) - 48px);
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 22px;
    padding: 8px;
    align-items: start
}

.case {
    --w: var(--case-w);
    --h: var(--case-h);
    width: 100%;
    max-width: 180px;
    display: flex;
    justify-content: center;
    user-select: none;
}

.case-inner {
    position: relative;
    width: var(--w);
    height: var(--h);
    transform-origin: left center;
    transition: transform .22s cubic-bezier(.2, .9, .2, 1), box-shadow .18s;
    box-sizing: border-box;
    border-top: 6px solid var(--case-border);
    border-right: 8px solid var(--case-border);
    border-bottom: 8px solid var(--case-border);
    background: linear-gradient(180deg, #0f1113 0%, #0b0c10 100%);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
    overflow: visible;
    cursor: grab;
}

.case-inner:active {
    cursor: grabbing
}

.case-inner::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 14%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .00));
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    pointer-events: none;
}

.case-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s cubic-bezier(.2, .9, .2, 1), box-shadow .18s;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .55);
    transform-origin: left center;
}

.case-front img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}


/* hover/open state */

.case:hover .case-inner {
    transform: rotateY(28deg) translateX(-14px) skewY(3deg) scaleX(0.95);
}

.sidebar {
    width: 220px;
    background: #0d0e11;
    padding: 12px;
    border-radius: 8px;
    box-sizing: border-box
}

.shelf-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.shelf-item {
    display: flex;
    gap: 3px;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background .12s
}

.shelf-item:hover {
    background: rgba(255, 255, 255, 0.02)
}

.shelf-item img {
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #0b0b0d
}

.page {
    background: #07080a;
    padding: 18px;
    border-radius: 10px;
    min-height: 300px
}

.hidden {
    display: none
}


/* drag disc */

.drag-disc {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center
}

.drag-disc img {
    width: 100%;
    height: 100%;
    display: block
}

@media (max-width:900px) {
    .wrap {
        flex-direction: column
    }
    .sidebar {
        width: 100%;
        order: 2
    }
    .shelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr))
    }
}