:root {
    --black: #000000;
    --orange: #D05511;
    --purple: #37257B;
    --purple-light: #6a52d4;
    --text: #f2e9e4;
    --muted: #b8a9a0;
    --box-bg: rgba(0, 0, 0, 0.6);
    --box-bg-orange: rgba(208, 85, 17, 0.6);
    --cut: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--black);
    color: var(--text);
    font-family: "Share Tech Mono", ui-monospace, monospace;
}

/* Matrix rain sits behind everything and never scrolls */
#matrix {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: block;
}

/* ---------- Cyberpunk boxes ---------- */

.cyber {
    position: relative;
    background: var(--box-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--orange);
    clip-path: polygon(
        var(--cut) 0, 100% 0,
        100% calc(100% - var(--cut)),
        calc(100% - var(--cut)) 100%,
        0 100%, 0 var(--cut)
    );
    box-shadow: inset 0 0 14px rgba(208, 85, 17, 0.18);
}

/* Diagonal border lines on the two cut corners + a small accent tab */
.cyber::before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(135deg, transparent 7.6px, var(--orange) 7.6px 9.2px, transparent 9.2px) top left / 14px 14px no-repeat,
        linear-gradient(-45deg, transparent 7.6px, var(--orange) 7.6px 9.2px, transparent 9.2px) bottom right / 14px 14px no-repeat,
        linear-gradient(var(--orange), var(--orange)) top 0 right 18px / 36px 3px no-repeat,
        linear-gradient(var(--purple-light), var(--purple-light)) bottom 0 left 18px / 20px 3px no-repeat;
}

/* ---------- Glitch on hover (0.5s) ---------- */

.glitch::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(transparent 0 30%, rgba(208, 85, 17, 0.35) 30% 34%, transparent 34% 62%,
                        rgba(55, 37, 123, 0.55) 62% 68%, transparent 68%);
}

.glitch:hover,
.glitch:focus-visible {
    animation: glitch 0.5s steps(1, end) 1;
}

.glitch:hover::after,
.glitch:focus-visible::after {
    animation: glitch-slices 0.5s steps(1, end) 1;
    mix-blend-mode: screen; /* only while glitching: blending is expensive to keep around */
}

.glitch:hover > *,
.glitch:focus-visible > * {
    animation: glitch-text 0.5s steps(1, end) 1;
}

@keyframes glitch {
    0%   { transform: translate(0, 0); }
    10%  { transform: translate(-4px, 1px) skewX(-6deg); }
    20%  { transform: translate(3px, -2px); }
    30%  { transform: translate(-2px, 0) skewX(4deg); }
    45%  { transform: translate(5px, 1px); }
    60%  { transform: translate(-3px, -1px) skewX(-3deg); }
    75%  { transform: translate(2px, 2px); }
    90%  { transform: translate(-1px, 0); }
    100% { transform: none; }
}

@keyframes glitch-slices {
    0%   { opacity: 1; transform: translateY(0); }
    20%  { opacity: 1; transform: translateY(-40%); }
    40%  { opacity: 0.8; transform: translateY(25%); }
    60%  { opacity: 1; transform: translateY(-15%) scaleY(0.6); }
    80%  { opacity: 0.6; transform: translateY(35%); }
    100% { opacity: 0; transform: none; }
}

@keyframes glitch-text {
    0%   { text-shadow: -3px 0 var(--purple-light), 3px 0 var(--orange); }
    25%  { text-shadow: 3px 0 var(--purple-light), -3px 0 var(--orange); }
    50%  { text-shadow: -2px 1px var(--purple-light), 2px -1px var(--orange); }
    75%  { text-shadow: 4px 0 var(--purple-light), -4px 0 var(--orange); }
    100% { text-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    .glitch:hover,
    .glitch:hover::after,
    .glitch:hover > * {
        animation: none;
    }
}

/* ---------- Embed ---------- */

.embed {
    padding: 14px;
}

/* Pulse at 170 BPM (60 / 170 = 0.353s per beat) while not hovered. Only the opacity of a
   pre-drawn glow layer is animated, which the GPU handles without repainting the panel. */
.beat-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 34px rgba(208, 85, 17, 0.6), inset 0 0 0 1px #ff7a33;
    opacity: 0;
}

.embed:not(:hover) .beat-glow {
    animation: beat 0.353s ease-out infinite;
}

@keyframes beat {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .embed:not(:hover) .beat-glow {
        animation: none;
    }
}

.embed iframe {
    display: block;
    border: 0;
    border-radius: 12px;
}


/* ---------- XMB (PS3-style menu) ---------- */

html,
body {
    height: 100%;
    overflow: hidden; /* the XMB is a single fixed screen */
    overscroll-behavior: none;
}

.xmb {
    position: fixed;
    inset: 0;
    z-index: 1;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Header: clock + sound toggle, title, subtitle (top right like the PS3 clock) */
.header {
    position: fixed;
    top: 20px;
    right: 28px;
    z-index: 2;
    text-align: right;
}

.status {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.sound-toggle {
    background: none;
    border: 1px solid rgba(208, 85, 17, 0.5);
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    padding: 3px 8px;
    cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
    color: var(--orange);
    border-color: var(--orange);
}

.title {
    font-family: "Orbitron", sans-serif;
    font-weight: 800;
    font-size: clamp(1.3rem, 3.2vw, 2.4rem);
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--text);
    text-shadow:
        -2px 0 var(--purple-light),
        2px 0 var(--orange),
        0 0 18px rgba(208, 85, 17, 0.55);
}

.subtitle {
    margin: 6px 0 0;
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
    letter-spacing: 0.4em;
    text-transform: lowercase;
    color: var(--orange);
}

/* Everything in the XMB is placed by xmb.js with transforms; these only animate */
.xmb-cat,
.xmb-item {
    position: absolute;
    left: 0;
    top: 0;
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), opacity 0.28s ease, visibility 0s;
    /* no will-change here: it would switch off the backdrop blur inside the boxes */
}

/* Items of other categories: hidden after fading out, so their blur and animations stop costing anything */
.xmb-item.is-hidden {
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), opacity 0.28s ease, visibility 0s linear 0.28s;
}

/* Categories */
.xmb-cat {
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
    padding: 0;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.xmb-cat svg {
    width: 64px;
    height: 64px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: filter 0.28s ease, color 0.28s ease;
}

.xmb-cat-label {
    font-family: "Orbitron", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.xmb-cat.is-active svg {
    color: #fff;
    filter: drop-shadow(0 0 6px var(--orange)) drop-shadow(0 0 14px rgba(208, 85, 17, 0.7));
}

.xmb-cat.is-active .xmb-cat-label {
    opacity: 1;
}

/* Items: an orange box with the brand icon, name and handle */
.xmb-item {
    display: block;
    color: var(--text);
    text-decoration: none;
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.xmb-box {
    display: flex;
    align-items: center;
    gap: 14px;
    width: var(--item-w, 300px);
    padding: 10px 14px 10px 10px;
    background: var(--box-bg-orange);
}

.xmb-icon {
    flex: none;
    width: 44px;
    height: 44px;
    background: #fff;
    -webkit-mask: var(--icon) center / 30px 30px no-repeat;
    mask: var(--icon) center / 30px 30px no-repeat;
}

.xmb-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.xmb-title {
    font-family: "Orbitron", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d9ccff;
    text-shadow: 0 0 6px rgba(55, 37, 123, 0.9);
}

.xmb-sub {
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xmb-hint {
    display: none;
    margin-left: auto;
    flex: none;
    font-size: 0.8rem;
    color: #fff;
    opacity: 0.85;
}

.xmb-item.is-active .xmb-box {
    box-shadow: inset 0 0 22px rgba(255, 140, 70, 0.55), 0 0 0 1px #ff7a33;
}

.xmb-item.is-dim .xmb-icon,
.xmb-item.is-dim .xmb-text {
    opacity: 0.6;
}

.xmb-item.is-active .xmb-hint {
    display: block;
}

.xmb-item.copied .xmb-hint {
    color: #d9ccff;
}

/* Spotify panel: shown next to the list while the playlist item is selected */
.xmb-embed {
    position: fixed;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.xmb-embed.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

/* Control hints, bottom right like the PS3 */
.controls {
    position: fixed;
    right: 28px;
    bottom: 18px;
    z-index: 2;
    display: flex;
    gap: 18px;
    font-size: 0.85rem;
    color: var(--muted);
}

.controls b {
    color: var(--orange);
    font-weight: normal;
}

@media (max-width: 700px) {
    .header {
        left: 16px;
        right: 16px;
        top: 14px;
        text-align: center;
    }

    .status {
        justify-content: center;
    }

    .controls {
        display: none; /* phones use tap and swipe */
    }

    .xmb-cat svg {
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xmb-cat,
    .xmb-item {
        transition-duration: 0.01s;
    }
}

/* ---------- Specs: details panel (Dead Space-style hologram, site colours) ---------- */

.xmb-details {
    position: fixed;
    z-index: 1;
    padding: 16px 20px 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: left center;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

.xmb-details.is-visible.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* allows scrolling the sheet on phones */
    transition: none;
    animation: holo-project 0.5s cubic-bezier(.2, .8, .2, 1) both;
}

/* Projected glass: faint orange tint, thin glowing frame, light blur so it stays readable */
.holo {
    background:
        linear-gradient(180deg, rgba(208, 85, 17, 0.16), rgba(208, 85, 17, 0.05) 40%, rgba(55, 37, 123, 0.12)),
        rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(208, 85, 17, 0.45);
    box-shadow:
        0 0 18px rgba(208, 85, 17, 0.35),
        inset 0 0 24px rgba(208, 85, 17, 0.18);
}

/* Bright bracket corners */
.holo::before {
    content: "";
    position: absolute;
    inset: -4px;
    pointer-events: none;
    --c: #ff8a4c;
    background:
        linear-gradient(var(--c), var(--c)) top left / 18px 2px no-repeat,
        linear-gradient(var(--c), var(--c)) top left / 2px 18px no-repeat,
        linear-gradient(var(--c), var(--c)) top right / 18px 2px no-repeat,
        linear-gradient(var(--c), var(--c)) top right / 2px 18px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / 18px 2px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / 2px 18px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / 18px 2px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / 2px 18px no-repeat;
    filter: drop-shadow(0 0 4px rgba(255, 138, 76, 0.9));
}

/* Scanlines + a slow scan bar sweeping down */
.holo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, rgba(255, 140, 80, 0.07) 0 1px, transparent 1px 3px);
}

/* The scan bar is its own layer moved with transform (no repaint per frame) */
.holo-sweep {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 60px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0, rgba(255, 138, 76, 0.14) 50%, transparent 100%);
    animation: holo-sweep 3.2s linear infinite;
}

.holo {
    overflow: hidden;
}

@keyframes holo-sweep {
    from { transform: translateY(-60px); }
    to   { transform: translateY(var(--sweep-h, 600px)); }
}

/* Projector: a thin line opens up, then the panel flickers once */
@keyframes holo-project {
    0%   { opacity: 0;   transform: scale(0.15, 0.02); }
    25%  { opacity: 1;   transform: scale(1, 0.02); }
    55%  { opacity: 0.9; transform: scale(1, 1); }
    62%  { opacity: 0.35; }
    68%  { opacity: 1; }
    74%  { opacity: 0.6; }
    80%, 100% { opacity: 1; transform: none; }
}

/* Scrolls only when the sheet is taller than the space; the panel itself never scrolls,
   so its corner brackets and animations can't add scroll bars */
.details-scroll {
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--orange) transparent;
}

.details-scroll::-webkit-scrollbar {
    width: 4px;
}

.details-scroll::-webkit-scrollbar-thumb {
    background: var(--orange);
}

/* Header: icon, name, slot counter, underline with tick marks */
.details-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    background:
        linear-gradient(90deg, var(--orange), rgba(208, 85, 17, 0.15)) bottom left / 100% 1px no-repeat,
        repeating-linear-gradient(90deg, rgba(255, 138, 76, 0.8) 0 1px, transparent 1px 12px) bottom 3px left 0 / 100% 4px no-repeat;
}

.details-head .xmb-icon {
    background: #ffb48a;
    filter: drop-shadow(0 0 4px rgba(208, 85, 17, 0.9));
}

.details-head > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.details-head .xmb-title {
    color: #ffd2b8;
    font-size: 0.9rem;
    letter-spacing: 0.22em;
    text-shadow: 0 0 8px rgba(208, 85, 17, 0.9);
}

.details-sub {
    color: rgba(242, 233, 228, 0.65);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.details-index {
    margin-left: auto;
    align-self: flex-start;
    font-family: "Orbitron", sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #d9ccff;
    text-shadow: 0 0 6px rgba(106, 82, 212, 0.9);
}

/* Rows: square marker, LABEL left, value right, thin divider; slide in one after another */
.details-rows {
    margin: 0;
    display: grid;
    gap: 0;
}

.details-rows > div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(208, 85, 17, 0.18);
    opacity: 0;
    transform: translateX(-6px);
}

.xmb-details.is-open .details-rows > div {
    animation: stat-in 0.25s ease forwards;
    animation-delay: calc(0.3s + var(--n) * 0.04s);
}

@keyframes stat-in {
    to { opacity: 1; transform: none; }
}

.details-rows dt {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    min-width: 76px;
    font-family: "Orbitron", sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #d9ccff;
    text-shadow: 0 0 6px rgba(106, 82, 212, 0.8);
}

.details-rows dt::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: none;
    background: var(--orange);
    box-shadow: 0 0 5px var(--orange);
}

/* Continuation rows (empty label): no marker */
.details-rows dt:empty::before {
    background: transparent;
    box-shadow: none;
}

.details-rows dd {
    margin: 0 0 0 auto;
    text-align: right;
    color: #ffe6d8;
    text-shadow: 0 0 6px rgba(208, 85, 17, 0.55);
}

.details-text {
    margin: 12px 0 0;
    color: var(--text);
    white-space: pre-line;
    line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
    .xmb-details.is-visible.is-open,
    .holo::after,
    .xmb-details.is-open .details-rows > div {
        animation-duration: 0.01s;
        animation-delay: 0s;
        animation-iteration-count: 1;
    }
}

/* Entries with an LED (the implant): the icon slowly pulses in the LED's colour */
.xmb-icon.has-led,
.details-head .xmb-icon.has-led {
    animation: led-pulse 2.4s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { background: #fff; }
    50%      { background: var(--led); }
}

@media (prefers-reduced-motion: reduce) {
    .xmb-icon.has-led,
    .details-head .xmb-icon.has-led {
        animation: none;
        background: var(--led);
    }
}



/* Small heading rows inside a stat sheet (e.g. "Owned" / "Previously owned") */
.details-rows > .details-section {
    padding: 10px 0 4px;
    border-bottom: 1px solid rgba(208, 85, 17, 0.5);
}

.details-rows > .details-section:first-child {
    padding-top: 0;
}

.details-section dt {
    color: var(--orange);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-shadow: 0 0 6px rgba(208, 85, 17, 0.8);
}

.details-section dt::before {
    display: none;
}

/* Keep rows without a value as tall as the others */
.details-rows > div:not(.details-section) {
    min-height: 29px;
}

.details-rows > div:not(.details-section) {
    align-items: center;
}

/* ---------- Games shelf (own tile design, no publisher artwork) ---------- */

.game-tile {
    display: flex;
    flex-direction: column;
    width: var(--tile-w, 150px);
    height: var(--tile-h, 206px);
    padding: 12px 12px 14px;
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.75)),
        var(--box-bg-orange);
    overflow: hidden;
}

.game-mono {
    flex: 1;
    display: grid;
    place-items: center;
    font-family: "Orbitron", sans-serif;
    font-weight: 800;
    font-size: var(--mono-size, 36px);
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 0 14px var(--accent), 0 0 2px var(--accent);
    white-space: nowrap;
    text-align: center;
    line-height: 1;
}

.game-title {
    font-family: "Orbitron", sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d9ccff;
    text-shadow: 0 0 6px rgba(55, 37, 123, 0.9);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 700px) {
    .game-title {
        font-size: 0.52rem;
        letter-spacing: 0.02em;
    }

    .game-year {
        font-size: 0.7rem;
        white-space: nowrap;
    }
}

.game-year {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text);
}

.xmb-tile.is-active .game-tile {
    box-shadow: inset 0 0 22px rgba(255, 140, 70, 0.55), 0 0 0 1px #ff7a33, 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent);
}

.xmb-tile.is-dim .game-tile > * {
    opacity: 0.6;
}

/* Shelf focus: outside the shelf the tiles are only a preview (no highlight) */
.xmb:not(.shelf-focus) .xmb-tile.is-active .game-tile {
    box-shadow: none;
}

.xmb:not(.shelf-focus) .xmb-tile .game-tile > * {
    opacity: 0.75;
}

.shelf-hint {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8rem;
    color: var(--muted);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.shelf-hint.is-visible {
    opacity: 1;
}

/* ---------- Legendary tile (most played game) ---------- */

.game-tile.is-legendary {
    clip-path: none;
    border-color: transparent;
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(255, 128, 0, 0.45), transparent 70%),
        linear-gradient(180deg, rgba(60, 25, 0, 0.35), rgba(0, 0, 0, 0.8)),
        var(--box-bg-orange);
}

.game-tile.is-legendary::before {
    display: none;
}

.game-tile.is-legendary .game-title {
    color: #ff8000; /* legendary item quality colour */
    text-shadow: 0 0 6px rgba(255, 128, 0, 0.7);
}

/* Gold frame drawn around the tile; the crest sticks out above it */
.legend-frame {
    position: absolute;
    left: calc(var(--tile-w, 150px) * -20 / 150);
    top: calc(var(--tile-h, 206px) * -20 / 206);
    width: calc(var(--tile-w, 150px) * 190 / 150);
    height: calc(var(--tile-h, 206px) * 246 / 206);
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(255, 128, 0, 0.8));
}

/* Pulsing glow behind the frame: only its opacity animates (cheap) */
.legend-aura {
    position: absolute;
    inset: -6px;
    pointer-events: none;
    box-shadow: 0 0 22px 6px rgba(255, 128, 0, 0.75);
    animation: aura-pulse 2.6s ease-in-out infinite;
}

@keyframes aura-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}

.xmb-tile.is-dim .legend-frame {
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    .legend-aura {
        animation: none;
        opacity: 0.7;
    }
}

/* ---------- Unholy theme (World of Warcraft: Unholy Death Knight) ---------- */

/* Selected inside the shelf: gold frame turns green (static filter, the aura pulses) */
.xmb-tile.theme-unholy.is-focused .legend-frame {
    filter: hue-rotate(80deg) saturate(1.5) drop-shadow(0 0 5px rgba(60, 255, 100, 0.8));
}

.xmb-tile.theme-unholy.is-focused .legend-aura {
    box-shadow: 0 0 22px 6px rgba(60, 255, 100, 0.7);
}

.theme-unholy.is-focused .game-tile.is-legendary {
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(60, 255, 100, 0.35), transparent 70%),
        linear-gradient(180deg, rgba(0, 40, 10, 0.4), rgba(0, 0, 0, 0.85)),
        rgba(10, 30, 12, 0.7);
}

/* Letters decay */
.theme-unholy.is-focused .game-mono {
    color: #c8ffbf;
    text-shadow:
        0 0 10px #39ff6a,
        0 4px 1px rgba(57, 255, 106, 0.4),
        0 9px 3px rgba(57, 255, 106, 0.2);
    filter: url(#decay);
}

.theme-unholy.is-focused .game-title {
    color: #6dff7f;
    text-shadow: 0 0 6px rgba(60, 255, 100, 0.7);
}

/* Description that unfolds under the selected tile */
.shelf-desc {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-left: 2px solid var(--orange);
    box-shadow: inset 0 0 14px rgba(208, 85, 17, 0.2);
    pointer-events: none;
    /* Closed = hidden instantly (visibility can't get stuck halfway like a fade-out can) */
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
}

.shelf-desc.is-open {
    visibility: visible;
    animation: desc-open 0.35s ease 0.1s both;
}

@keyframes desc-open {
    from { opacity: 0; clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

.shelf-desc-main {
    font-family: "Orbitron", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffd2b8;
}

.shelf-desc-sub {
    font-size: 0.9rem;
    color: var(--text);
}

.shelf-desc.theme-unholy {
    border-left-color: #39ff6a;
    box-shadow: inset 0 0 16px rgba(60, 255, 100, 0.18), 0 0 12px rgba(60, 255, 100, 0.25);
}

.shelf-desc.theme-unholy .shelf-desc-main {
    color: #6dff7f;
    text-shadow: 0 0 6px rgba(60, 255, 100, 0.7);
}

@media (prefers-reduced-motion: reduce) {
    .theme-unholy.is-focused .game-mono {
        filter: none;
    }
    .shelf-desc,
    .shelf-desc.is-open {
        transition: none;
        animation: none;
    }
}

/* ---------- Lite mode (set by script.js on weak machines) ----------
   No backdrop blur (the most expensive effect over the animated rain); boxes get a more
   opaque background instead so text stays readable. Decorative loops are switched off. */
html.lite {
    --box-bg: rgba(0, 0, 0, 0.85);
    --box-bg-orange: rgba(150, 60, 12, 0.9);
}

html.lite .cyber,
html.lite .holo,
html.lite .shelf-desc {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

html.lite .holo {
    background: rgba(12, 6, 3, 0.92);
}

html.lite .shelf-desc {
    background: rgba(0, 0, 0, 0.88);
}

html.lite .holo-sweep,
html.lite .legend-aura {
    animation: none;
}

html.lite .theme-unholy.is-focused .game-mono {
    filter: none;
}
