@font-face {
    font-family: 'VXPixelTitle';
    src: url('../assets/pixel-ui/fonts/title-pixel.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'VXPixelTitleBold';
    src: url('../assets/pixel-ui/fonts/title-pixel-bold.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'VXPixelHud';
    src: url('../assets/pixel-ui/fonts/hud-pixel.ttf') format('truetype');
    font-display: swap;
}

:root {
    --vx-bg: #0d0716;
    --vx-bg-deep: #130b22;
    --vx-panel: #1a1028;
    --vx-panel-soft: #25143c;
    --vx-panel-highlight: #341b55;
    --vx-line: #4e3474;
    --vx-line-bright: #ac87ff;
    --vx-text: #f7f1ff;
    --vx-muted: #b8abcf;
    --vx-muted-2: #8e84a8;
    --vx-violet: #8f53ff;
    --vx-violet-2: #6f3fe0;
    --vx-cyan: #6ce8ff;
    --vx-gold: #ffcf73;
    --vx-red: #ff6e8d;
    --vx-green: #7dff98;
    --vx-shadow: 0 10px 0 rgba(5, 3, 10, 0.35), 0 18px 28px rgba(2, 0, 6, 0.48);
    --vx-shadow-soft: 0 6px 16px rgba(4, 1, 9, 0.38);
    --vx-frame: url('../assets/pixel-ui/frames/window-border.png');
    --vx-panel-fill: url('../assets/pixel-ui/panels/panel-fill.png');
    --vx-window-glass: url('../assets/pixel-ui/windows/window-translucent.png');
    --vx-floor-tile: url('../assets/game/tilesets/floor-stone-tile.png');
    --vx-slot-bg: url('../assets/pixel-ui/slots/inventory-slot.png');
    --vx-ease: 180ms steps(3);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--vx-text);
    background:
        radial-gradient(circle at top, rgba(143, 83, 255, 0.24), transparent 24%),
        radial-gradient(circle at 85% 15%, rgba(107, 232, 255, 0.11), transparent 18%),
        linear-gradient(180deg, #10081c, #0b0614 42%, #09040f 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--vx-floor-tile);
    background-size: 32px 32px;
    opacity: 0.08;
    image-rendering: pixelated;
    pointer-events: none;
}

img {
    max-width: 100%;
    display: block;
    image-rendering: pixelated;
}

canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.theme-blank {
    min-height: 100vh;
}

.vx-body {
    position: relative;
}

.vx-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.vx-main {
    padding: 20px 18px 30px;
}

.page-grid {
    display: grid;
    gap: 18px;
}

.pixel-kicker {
    margin: 0 0 8px;
    font-family: 'VXPixelHud', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    color: var(--vx-gold);
    text-transform: uppercase;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100vh;
    padding: 18px 16px;
    background: linear-gradient(180deg, rgba(19, 10, 31, 0.97), rgba(12, 6, 20, 0.99));
    border-right: 2px solid rgba(255, 255, 255, 0.03);
}

.vx-brand,
.vx-nav,
.vx-side-hud,
.vx-admin-entry,
.vx-topbar,
.pixel-window,
.pixel-panel {
    background: linear-gradient(180deg, rgba(37, 21, 57, 0.96), rgba(20, 11, 32, 0.96));
}

.vx-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vx-brand:hover {
    transform: translateY(-1px);
}

.vx-brand-logo {
    width: 62px;
    height: 62px;
    filter: drop-shadow(0 6px 10px rgba(143, 83, 255, 0.28));
}

.vx-brand strong {
    display: block;
    font-family: 'VXPixelTitleBold', sans-serif;
    font-size: 1.2rem;
}

.vx-brand small {
    color: var(--vx-muted);
}

.vx-nav {
    display: grid;
    gap: 10px;
}

.vx-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 2px solid transparent;
    color: var(--vx-muted);
    transition: transform var(--vx-ease), background var(--vx-ease), color var(--vx-ease), border-color var(--vx-ease);
}

.vx-nav-link.is-active,
.vx-nav-link:hover,
.vx-admin-entry.is-active {
    border-color: var(--vx-line-bright);
    color: var(--vx-text);
    background: rgba(143, 83, 255, 0.16);
    transform: translateY(-1px);
}

.vx-nav-glyph {
    width: 24px;
    text-align: center;
    font-family: 'VXPixelHud', monospace;
    color: var(--vx-gold);
}

.vx-nav-label {
    font-family: 'VXPixelHud', monospace;
    letter-spacing: 0.04em;
}

.vx-side-hud h3 {
    margin: 0 0 8px;
    font-family: 'VXPixelTitleBold', sans-serif;
}

.vx-side-hud p {
    margin: 0 0 10px;
    color: var(--vx-muted);
}

.vx-side-meter {
    display: grid;
    gap: 6px;
}

.vx-admin-entry {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
}

.vx-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.vx-topbar-copy {
    min-width: 0;
}

.vx-topbar h1 {
    margin: 0;
    font-family: 'VXPixelTitleBold', sans-serif;
    font-size: clamp(1.6rem, 2.5vw, 2.5rem);
}

.vx-topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pixel-userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.pixel-userbox strong,
.pixel-userbox small {
    display: block;
}

.pixel-userbox small,
.vx-topbar small,
.muted {
    color: var(--vx-muted);
}

.pixel-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    font-family: 'VXPixelTitleBold', sans-serif;
    color: #180a18;
    background: linear-gradient(180deg, var(--vx-gold), #ff9f43);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--vx-green);
    box-shadow: 0 0 10px rgba(125, 255, 152, 0.8);
}

.flash {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 2px solid;
    font-family: 'VXPixelHud', monospace;
    background: rgba(12, 7, 18, 0.92);
    box-shadow: var(--vx-shadow-soft);
}

.flash-success {
    color: #d9ffe1;
    border-color: rgba(125, 255, 152, 0.5);
}

.flash-error {
    color: #ffd0d9;
    border-color: rgba(255, 110, 141, 0.55);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--vx-gold);
    font-family: 'VXPixelHud', monospace;
}

.back-link:hover {
    color: #ffe4af;
}

.pixel-form {
    display: grid;
    gap: 14px;
}

.pixel-form.compact,
.stack-form.compact {
    gap: 10px;
}

.pixel-form label,
.vx-admin-settings label,
.stack-form label {
    display: grid;
    gap: 8px;
}

.pixel-form span,
.vx-admin-settings span,
.stack-form span {
    color: var(--vx-muted);
    font-family: 'VXPixelHud', monospace;
    font-size: 0.84rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--vx-text);
    background: linear-gradient(180deg, rgba(49, 29, 73, 0.9), rgba(15, 8, 24, 0.98));
    border: 2px solid rgba(171, 134, 255, 0.22);
    outline: none;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05);
}

textarea {
    min-height: 112px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(107, 232, 255, 0.62);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), 0 0 0 2px rgba(107, 232, 255, 0.12);
}

::placeholder {
    color: var(--vx-muted-2);
}

.stack-form {
    display: grid;
    gap: 12px;
}

h2,
h3,
h4 {
    line-height: 1.06;
}

p {
    line-height: 1.6;
}

@media (max-width: 1140px) {
    .vx-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }
}

@media (max-width: 780px) {
    .vx-main {
        padding: 14px 12px 20px;
    }

    .vx-topbar,
    .vx-topbar-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
