:root {
    --font-ui: "Segoe UI", Tahoma, "Noto Sans", sans-serif;
    --ink: #1a1a1a;
    --ink-mid: #4a4a4a;
    --ink-soft: #5a5a5a;
    --ink-muted: #6b6b6b;
    --line: #7a7a7a;
    --surface: #fff;
}

* {
    box-sizing: border-box;
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_arrow.cur"),
        auto;
}

a,
a[role="button"],
button {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_link.cur"),
        pointer;
}

a:active,
a[role="button"]:active,
button:active {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_select.cur"),
        pointer;
}

input,
textarea,
[contenteditable] {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_text.cur"),
        text;
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    padding: calc(24px + env(safe-area-inset-top))
        calc(16px + env(safe-area-inset-right))
        calc(24px + env(safe-area-inset-bottom))
        calc(16px + env(safe-area-inset-left));
    font-family: var(--font-ui);
    background: linear-gradient(180deg, #e1e1e1 0%, #cfcfcf 45%, #bcbcbc 100%);
    background-attachment: fixed;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--surface);
    color: #000;
    padding: 8px 12px;
    z-index: 100;
    border: 2px solid var(--ink-muted);
}
.skip-link:focus {
    left: 16px;
    top: 16px;
}

.card-window {
    width: 100%;
    max-width: 480px;
    margin: auto;
    --w7-w-bg: #969696;
}

.window-body h1 {
    margin: 4px 0 0;
    font-size: 1.6rem;
    line-height: 1.1;
    font-weight: 600;
    color: var(--ink);
}

.window-body .subtitle {
    margin: 2px 0 16px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.link-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-list a[role="button"] {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    text-align: left;
}

.link-list svg {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--ink-mid);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

fieldset.photo-box {
    margin: 0 0 4px;
}

fieldset.avatar-box {
    margin: 0 0 4px;
}

.avatar-wrap {
    position: relative;
    display: block;
    width: 139px;
    margin: 0 auto;
}

.avatar-frame {
    position: relative;
    display: block;
    width: 139px;
    height: 139px;
    margin: 0 auto;
    overflow: hidden;
}

#discord-avatar {
    position: absolute;
    top: 19px;
    left: 25px;
    width: 93px;
    height: 93px;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.photo-frame {
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px var(--surface);
}

.photo-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

figcaption.credit {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--ink-muted);
    text-align: right;
}

figcaption.credit a {
    color: var(--ink-mid);
}

.title-bar-controls button {
    cursor: default;
}

fieldset.now-playing-box {
    margin: 0 0 4px;
}

.np-empty {
    margin: 0;
    padding: 4px 2px;
    font-size: 0.95rem;
    color: var(--ink-muted);
    font-style: italic;
}

.np-track {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.np-jewel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
}

@keyframes np-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

.np-disc {
    position: absolute;
    width: 72px;
    height: 72px;
    margin-left: -25px;
    margin-right: -2px;
    z-index: 1;
    animation: np-spin 0.9s linear infinite;
    transition: margin-left 0.6s ease;
}

.np-jewel:hover .np-disc {
    margin-left: -33px;
}

.np-art {
    position: static;
    margin-left: 7px;
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px var(--surface);
    z-index: 2;
}

@keyframes np-wiggle {
    0%,
    88%,
    100% {
        transform: none;
    }
    90% {
        transform: rotate(-1.6deg) translateX(-2px);
    }
    93% {
        transform: rotate(1.1deg) translateX(1px);
    }
    96% {
        transform: rotate(-0.5deg);
    }
}

.np-case {
    position: absolute;
    top: -2px;
    margin-left: 1px;
    width: 80px;
    height: 74px;
    z-index: 3;
    transform-origin: left center;
    animation: np-wiggle 4s ease-in-out infinite;
}

.np-meta {
    min-width: 0;
    flex: 1;
}

.np-title,
.np-artist {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.np-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 1.05rem;
}

.np-artist {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-top: 1px;
}

.np-progress-wrap {
    margin: 8px 0 4px;
}

.np-progress {
    height: 8px;
    background: #c0c0c0;
    border: 1px solid var(--line);
    overflow: hidden;
}

.np-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--ink);
    transition: width 1s linear;
}

.np-times {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

a:focus-visible,
a[role="button"]:focus-visible {
    outline: none;
}

.status-bar .status-bar-field {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visitors {
    position: absolute;
    top: -28px;
    right: -118px;
    width: max-content;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0.4em 0.8em;
    font-size: 0.8rem;
    color: #1a1a1a;
    z-index: 10;
}

.visitors:before {
    left: auto;
    right: 110px;
}

.v-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.visitors:not(:has(.v-stat)) {
    display: none;
}

@media (max-width: 480px) {
    .visitors {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .visitors:before {
        right: 74px;
    }

    .card-window {
        max-width: 92vw;
        margin-bottom: 32px;
    }
    .window-body h1 {
        font-size: 1.4rem;
    }
    .np-jewel {
        width: auto;
    }
    .np-disc {
        width: 64px;
        height: 64px;
        margin-left: -22px;
        margin-right: -2px;
    }
    .np-art {
        margin-left: 6px;
        width: 64px;
        height: 64px;
    }
    .np-case {
        top: -1px;
        margin-left: 1px;
        width: 71px;
        height: 66px;
    }
    .np-title {
        font-size: 0.95rem;
    }
    .np-artist {
        font-size: 0.82rem;
    }
}

@media (max-width: 520px) {
    .v-last {
        display: none;
    }
}

@media (max-width: 360px) {
    fieldset.avatar-box {
        position: relative;
    }

    .avatar-wrap {
        position: static;
    }

    .visitors {
        top: -18px;
        right: -6px;
        left: auto;
        transform: none;
        width: max-content;
        flex-wrap: nowrap;
        gap: 5px;
        padding: 0.3em 0.5em;
        font-size: 0.7rem;
    }

    .v-last {
        display: none;
    }

    .visitors:before {
        top: calc(var(--w7-blt-size) * -1);
        bottom: unset;
        left: var(--w7-blt-offset);
        right: auto;
        transform: none;
    }

    body {
        padding-block: calc(16px + env(safe-area-inset-top))
            calc(16px + env(safe-area-inset-bottom));
    }
    .card-window {
        max-width: calc(100vw - 16px);
    }
    .window-body h1 {
        font-size: 1.3rem;
    }
    .np-jewel {
        width: auto;
    }
    .np-disc {
        width: 56px;
        height: 56px;
        margin-left: -19px;
        margin-right: -2px;
    }
    .np-art {
        margin-left: 5px;
        width: 56px;
        height: 56px;
    }
    .np-case {
        top: -1px;
        margin-left: 1px;
        width: 62px;
        height: 58px;
    }
    .np-title {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    .np-disc {
        animation: np-spin 0.9s linear infinite !important;
        transition: margin-left 0.6s ease !important;
    }

    .np-case {
        animation: np-wiggle 4s ease-in-out infinite !important;
    }
}

[disabled],
[aria-disabled="true"] {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_unavail.cur"),
        not-allowed;
}

.wait,
[aria-busy="true"],
.loading {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_busy.ani"),
        wait;
}

.progress {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_working.ani"),
        progress;
}

.help {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_helpsel.cur"),
        help;
}

.ns-resize,
[style*="ns-resize"],
[class*="ns-resize"] {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_ns.cur"),
        ns-resize;
}

.ew-resize,
[style*="ew-resize"],
[class*="ew-resize"] {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_ew.cur"),
        ew-resize;
}

.nwse-resize {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_nwse.cur"),
        nwse-resize;
}

.nesw-resize {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_nesw.cur"),
        nesw-resize;
}

.move,
[style*="move"] {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_move.cur"),
        move;
}

.title-bar-controls button {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_arrow.cur"),
        default;
}

.title-bar {
    cursor:
        url("assets/images/cursors/windows vista-7 cursor/windows7_move.cur"),
        default;
}
