* {
    box-sizing: border-box;
}

:root,
html[data-theme="dark"] {
    --bg: #101721;
    --panel: rgba(18, 31, 26, 0.9);
    --panel-border: rgba(112, 154, 118, 0.26);
    --text: #edf6eb;
    --muted: #a6c0a9;
    --accent: #8fd89a;
    --accent-dim: #5c8f6a;
    --floor-a: #314735;
    --floor-b: #24362c;
    --floor-c: #1b2b22;
    --wall-a: #48604d;
    --wall-b: #394d40;
    --wall-c: #2b3c31;
    --player-gold: #d9bf73;
    --player-shadow: #6f5a27;
    --toolbar-bg: rgba(18, 28, 25, 0.32);
    --card-top-gloss: rgba(132, 189, 140, 0.14);
    --card-bg: rgba(17, 27, 20, 0.86);
    --card-shadow: rgba(0, 0, 0, 0.3);
    --status-border: rgba(143, 216, 154, 0.24);
    --dungeon-glow: rgba(118, 176, 127, 0.22);
    --dungeon-bg: rgba(16, 25, 18, 0.94);
    --dungeon-shadow: rgba(0, 0, 0, 0.35);
    --button-highlight: rgba(215, 237, 214, 0.08);
    --button-shadow: rgba(0, 0, 0, 0.18);
    --button-press-shadow: rgba(0, 0, 0, 0.16);
    --hero-glow: rgba(255, 153, 82, 0.18);
    --hero-accent: rgba(118, 160, 222, 0.16);
    --leaf-tint: rgba(88, 131, 90, 0.14);
    --firefly: rgba(226, 241, 157, 0.58);
}

html[data-theme="light"] {
    --bg: #f1f8ff;
    --panel: rgba(255, 252, 246, 0.9);
    --panel-border: rgba(119, 157, 111, 0.26);
    --text: #253423;
    --muted: #60755d;
    --accent: #4f8b4d;
    --accent-dim: #86b27c;
    --floor-a: #dceacb;
    --floor-b: #d1e2be;
    --floor-c: #c4d8b0;
    --wall-a: #96b086;
    --wall-b: #819d73;
    --wall-c: #6d8761;
    --player-gold: #ab7f24;
    --player-shadow: #6c5321;
    --toolbar-bg: rgba(255, 255, 255, 0.18);
    --card-top-gloss: rgba(255, 255, 255, 0.72);
    --card-bg: rgba(255, 253, 248, 0.84);
    --card-shadow: rgba(87, 110, 79, 0.14);
    --status-border: rgba(96, 117, 93, 0.22);
    --dungeon-glow: rgba(162, 196, 122, 0.22);
    --dungeon-bg: rgba(252, 252, 247, 0.9);
    --dungeon-shadow: rgba(89, 110, 82, 0.18);
    --button-highlight: rgba(255, 255, 255, 0.45);
    --button-shadow: rgba(87, 110, 79, 0.1);
    --button-press-shadow: rgba(87, 110, 79, 0.08);
    --hero-glow: rgba(255, 225, 150, 0.3);
    --hero-accent: rgba(170, 224, 160, 0.24);
    --leaf-tint: rgba(132, 173, 117, 0.12);
    --firefly: rgba(255, 228, 148, 0.18);
}


*::selection {
    background: rgba(142, 225, 136, 0.3);
}

body {
    margin: 0;
    min-height: 260vh;
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    position: relative;
    --world-background-height: 5000px;
}

html[data-theme="dark"] body {
    background:
        linear-gradient(180deg, #17253d 0px, #2b4369 1100px, #3f5d5d 2200px, #5f854d 3200px, #4f7b3f 4300px, #3f5a31 5200px, #8d6c47 6500px, #6d5038 7900px, #536067 9000px, #1a2430 10000px),
        radial-gradient(320px 120px at 18% 420px, rgba(255, 255, 255, 0.18), transparent 72%),
        radial-gradient(420px 130px at 78% 560px, rgba(214, 226, 255, 0.2), transparent 72%),
        radial-gradient(260px 90px at 54% 980px, rgba(255, 204, 136, 0.14), transparent 70%),
        radial-gradient(18px 10px at 14% 840px, rgba(235, 244, 221, 0.82), transparent 70%),
        radial-gradient(22px 11px at 18% 780px, rgba(235, 244, 221, 0.82), transparent 70%),
        radial-gradient(16px 9px at 74% 720px, rgba(235, 244, 221, 0.8), transparent 70%),
        radial-gradient(20px 10px at 78% 780px, rgba(235, 244, 221, 0.82), transparent 70%),
        radial-gradient(22px 12px at 58% 1020px, rgba(235, 244, 221, 0.78), transparent 70%),
        radial-gradient(13px 7px at 24% 860px, rgba(244, 233, 173, 0.82), transparent 72%),
        radial-gradient(10px 6px at 27% 895px, rgba(244, 233, 173, 0.72), transparent 72%),
        radial-gradient(12px 7px at 71% 840px, rgba(247, 228, 156, 0.78), transparent 72%),
        radial-gradient(9px 5px at 68% 880px, rgba(247, 228, 156, 0.66), transparent 72%),
        radial-gradient(7px 4px at 36% 760px, rgba(28, 24, 34, 0.72), transparent 72%),
        radial-gradient(8px 5px at 39% 748px, rgba(28, 24, 34, 0.68), transparent 72%),
        radial-gradient(7px 4px at 63% 824px, rgba(26, 22, 31, 0.7), transparent 72%),
        radial-gradient(8px 5px at 66% 812px, rgba(26, 22, 31, 0.66), transparent 72%),
        radial-gradient(6px 6px at 31% 4580px, rgba(255, 214, 82, 0.68), transparent 70%),
        radial-gradient(4px 4px at 31.8% 4572px, rgba(34, 28, 18, 0.64), transparent 70%),
        radial-gradient(6px 6px at 72% 4720px, rgba(255, 205, 70, 0.66), transparent 70%),
        radial-gradient(4px 4px at 72.8% 4712px, rgba(34, 28, 18, 0.6), transparent 70%),
        linear-gradient(180deg, transparent 0 3000px, rgba(110, 150, 76, 0.22) 3000px 5200px, transparent 5200px),
        radial-gradient(140px 340px at 14% 4160px, rgba(56, 102, 42, 0.46), transparent 74%),
        radial-gradient(160px 360px at 24% 4380px, rgba(64, 112, 48, 0.42), transparent 74%),
        radial-gradient(150px 340px at 78% 4220px, rgba(66, 110, 50, 0.44), transparent 74%),
        radial-gradient(160px 360px at 86% 4440px, rgba(52, 98, 40, 0.42), transparent 74%),
        radial-gradient(10px 10px at 18% 4700px, rgba(240, 204, 104, 0.74), transparent 72%),
        radial-gradient(8px 8px at 20% 4640px, rgba(204, 214, 102, 0.72), transparent 72%),
        radial-gradient(9px 9px at 22% 4740px, rgba(211, 110, 136, 0.72), transparent 72%),
        radial-gradient(10px 10px at 80% 4680px, rgba(237, 199, 92, 0.74), transparent 72%),
        radial-gradient(8px 8px at 82% 4760px, rgba(201, 104, 128, 0.72), transparent 72%),
        linear-gradient(180deg, transparent 0 5600px, rgba(80, 56, 38, 0.22) 5600px 8200px, transparent 8200px),
        repeating-linear-gradient(96deg, transparent 0 220px, rgba(47, 31, 20, 0.22) 220px 226px, transparent 226px 420px),
        repeating-linear-gradient(84deg, transparent 0 260px, rgba(59, 38, 24, 0.16) 260px 266px, transparent 266px 520px),
        radial-gradient(380px 120px at 28% 8600px, rgba(88, 170, 188, 0.24), transparent 74%),
        radial-gradient(420px 130px at 74% 9100px, rgba(96, 184, 205, 0.22), transparent 74%),
        repeating-linear-gradient(122deg, transparent 0 320px, rgba(72, 58, 44, 0.2) 320px 326px, transparent 326px 620px);
    background-repeat: no-repeat;
    background-size: 100% var(--world-background-height);
    background-position: center top;
    background-color: #17253d;
}

html[data-theme="light"] body {
    background:
        linear-gradient(180deg, #9ed4ff 0px, #d8f1ff 1100px, #ebf9ff 2100px, #c8ecda 3000px, #94c968 3900px, #79aa54 5000px, #b58a59 6500px, #936a45 7900px, #859a91 9000px, #62737b 10000px),
        radial-gradient(320px 120px at 18% 420px, rgba(255, 255, 255, 0.95), transparent 72%),
        radial-gradient(420px 130px at 78% 560px, rgba(255, 255, 255, 0.9), transparent 72%),
        radial-gradient(260px 90px at 54% 980px, rgba(255, 249, 226, 0.72), transparent 70%),
        radial-gradient(18px 10px at 14% 840px, rgba(88, 108, 82, 0.82), transparent 70%),
        radial-gradient(22px 11px at 18% 780px, rgba(88, 108, 82, 0.82), transparent 70%),
        radial-gradient(16px 9px at 74% 720px, rgba(88, 108, 82, 0.8), transparent 70%),
        radial-gradient(20px 10px at 78% 780px, rgba(88, 108, 82, 0.82), transparent 70%),
        radial-gradient(22px 12px at 58% 1020px, rgba(88, 108, 82, 0.78), transparent 70%),
        linear-gradient(180deg, transparent 0 3000px, rgba(120, 184, 84, 0.22) 3000px 5200px, transparent 5200px),
        radial-gradient(140px 340px at 14% 4160px, rgba(88, 149, 58, 0.46), transparent 74%),
        radial-gradient(160px 360px at 24% 4380px, rgba(100, 164, 66, 0.42), transparent 74%),
        radial-gradient(150px 340px at 78% 4220px, rgba(91, 151, 59, 0.44), transparent 74%),
        radial-gradient(160px 360px at 86% 4440px, rgba(82, 140, 53, 0.42), transparent 74%),
        radial-gradient(10px 10px at 18% 4700px, rgba(250, 205, 86, 0.88), transparent 72%),
        radial-gradient(8px 8px at 20% 4640px, rgba(202, 216, 98, 0.86), transparent 72%),
        radial-gradient(9px 9px at 22% 4740px, rgba(220, 116, 150, 0.84), transparent 72%),
        radial-gradient(10px 10px at 80% 4680px, rgba(255, 194, 72, 0.88), transparent 72%),
        radial-gradient(8px 8px at 82% 4760px, rgba(218, 108, 142, 0.84), transparent 72%),
        linear-gradient(180deg, transparent 0 5600px, rgba(138, 100, 64, 0.18) 5600px 8200px, transparent 8200px),
        repeating-linear-gradient(96deg, transparent 0 220px, rgba(98, 68, 40, 0.18) 220px 226px, transparent 226px 420px),
        repeating-linear-gradient(84deg, transparent 0 260px, rgba(120, 82, 48, 0.14) 260px 266px, transparent 266px 520px),
        radial-gradient(380px 120px at 28% 8600px, rgba(104, 190, 212, 0.3), transparent 74%),
        radial-gradient(420px 130px at 74% 9100px, rgba(86, 166, 192, 0.28), transparent 74%),
        repeating-linear-gradient(122deg, transparent 0 320px, rgba(86, 66, 46, 0.16) 320px 326px, transparent 326px 620px);
    background-repeat: no-repeat;
    background-size: 100% var(--world-background-height);
    background-position: center top;
    background-color: #9ed4ff;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        radial-gradient(circle at 8% 26%, var(--leaf-tint), transparent 14%),
        radial-gradient(circle at 92% 30%, var(--leaf-tint), transparent 16%),
        radial-gradient(circle at 18% 82%, rgba(114, 156, 103, 0.08), transparent 18%),
        radial-gradient(circle at 80% 78%, rgba(114, 156, 103, 0.08), transparent 18%);
    filter: blur(10px);
}

html[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 7% 20%, rgba(200, 226, 184, 0.22), transparent 18%),
        radial-gradient(circle at 91% 28%, rgba(172, 214, 161, 0.18), transparent 18%),
        linear-gradient(180deg, transparent 0%, transparent 62%, rgba(94, 123, 71, 0.08) 76%, rgba(73, 49, 31, 0.12) 100%);
}

body::after {
    background:
        radial-gradient(circle at 16% 18%, var(--firefly) 0 2px, transparent 3px),
        radial-gradient(circle at 77% 24%, var(--firefly) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 68% 54%, var(--firefly) 0 2px, transparent 3px),
        radial-gradient(circle at 25% 64%, var(--firefly) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 84% 82%, var(--firefly) 0 2px, transparent 3px),
        radial-gradient(circle at 22% 22%, rgba(255, 232, 156, 0.44) 0 1.6px, transparent 2.8px),
        radial-gradient(circle at 58% 26%, rgba(255, 236, 170, 0.4) 0 1.4px, transparent 2.6px),
        radial-gradient(circle at 74% 34%, rgba(255, 229, 145, 0.38) 0 1.5px, transparent 2.7px),
        radial-gradient(circle at 18% 58%, rgba(255, 214, 120, 0.34) 0 1.3px, transparent 2.5px),
        radial-gradient(circle at 82% 66%, rgba(255, 224, 148, 0.34) 0 1.3px, transparent 2.5px),
        radial-gradient(circle at 35% 74%, rgba(255, 232, 162, 0.28) 0 1.2px, transparent 2.4px);
    opacity: 0.6;
}

html[data-theme="light"] body::after {
    opacity: 0.18;
}

.site-header h1,
.site-header .lead {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.site-header h1,
.site-header .lead {
    width: 100%;
}

html[data-theme="light"] .site-header h1,
html[data-theme="light"] .site-header .lead {
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.24);
}

.site-header .lead {
    display: block;
    text-align: left;
}

.site-header .lead::before,
.site-header .lead::after {
    content: "";
    display: inline-block;
    width: 42px;
    height: 12px;
    margin: 0 12px;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.32;
}

.site-header .lead::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 20'%3E%3Cpath fill='rgba(245,245,235,0.9)' d='M6 11c8-1 13-7 16-9 0 3-1 6-4 8 6-2 11-7 13-9 1 4-2 9-6 11 7-1 12 0 19 5-8 1-14-1-19-3-5 4-11 5-19 3 4-3 8-5 13-6-5-1-9 0-13 0z'/%3E%3C/svg%3E");
}

.site-header .lead::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 20'%3E%3Cpath fill='rgba(245,245,235,0.9)' d='M58 11c-8-1-13-7-16-9 0 3 1 6 4 8-6-2-11-7-13-9-1 4 2 9 6 11-7-1-12 0-19 5 8 1 14-1 19-3 5 4 11 5 19 3-4-3-8-5-13-6 5-1 9 0 13 0z'/%3E%3C/svg%3E");
}

html[data-theme="light"] .site-header .lead::before,
html[data-theme="light"] .site-header .lead::after {
    opacity: 0.4;
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.28));
}

html[data-theme="dark"] .project-detail-header {
    background: transparent;
}

.player-stats-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}

.player-stats-bar.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.player-stats-panel {
    margin-top: 8px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 10px 12px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(14, 12, 19, 0.92);
    box-shadow: 0 10px 24px var(--card-shadow);
    pointer-events: auto;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.player-stats-panel-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    max-width: 100%;
}

.player-stats-line {
    flex: 0 0 auto;
    width: max-content;
    max-width: min(100%, 72vw);
    padding: 9px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.player-stats-reset,
.player-stats-shop {
    pointer-events: auto;
}

.site-header {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 24px 0;
}

.site-header::before {
    content: none;
}

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

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-right {
    margin-left: auto;
}

.breadcrumb-trail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumb-trail a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb-trail a:hover {
    color: var(--text);
}

.breadcrumb-separator {
    opacity: 0.7;
}

.breadcrumb-button {
    text-decoration: none;
}

.breadcrumb-button:hover {
    text-decoration: none;
}

.breadcrumb-button.current {
    cursor: default;
}

.language-switch,
.theme-switch {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-button {
    border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent 20%);
    background: var(--toolbar-bg);
    backdrop-filter: blur(3px);
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 var(--button-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03),
        0 2px 5px var(--button-shadow);
    transform: translateY(0);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.toolbar-button:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 var(--button-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04),
        0 4px 8px var(--button-shadow);
}

.toolbar-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.08),
        0 1px 2px var(--button-press-shadow);
}

.toolbar-button.active {
    color: var(--text);
    border-color: var(--accent);
}

.toolbar-button-reset {
    color: #f1c5cf;
}

html[data-theme="light"] .toolbar-button-reset {
    color: #a45b74;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-size: 0.82rem;
}

h1 {
    margin: 0 0 12px;
    max-width: 100%;
    font-size: clamp(2rem, 4vw, 3.9rem);
    line-height: 1.05;
}

.headline-author {
    display: inline-block;
    margin-left: 0.45rem;
    color: var(--muted);
    font-size: 0.28em;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.lead {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.lead-tag {
    display: inline-block;
    margin-left: 0.45rem;
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-layout {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 452px minmax(260px, 1fr);
    gap: 26px;
    align-items: start;
    overflow-x: clip;
}

.project-column {
    display: grid;
    gap: 18px;
}

.project-card {
    --project-accent: var(--accent);
    position: relative;
    overflow: hidden;
    padding: 20px 20px 22px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(170, 214, 150, 0.12), transparent 24%),
        linear-gradient(180deg, var(--card-top-gloss), transparent 24%),
        var(--card-bg);
    box-shadow: 0 14px 38px var(--card-shadow);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--project-accent), rgba(142, 225, 136, 0.05));
}

.project-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.project-status {
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--status-border);
    border-radius: 999px;
    padding: 4px 8px;
    white-space: nowrap;
}

.project-card h2 {
    margin: 8px 0 8px;
    font-size: 1.22rem;
}

.project-card-title-link {
    color: inherit;
    text-decoration: none;
}

.project-card-title-link:hover {
    color: var(--project-accent);
}

.project-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
    white-space: pre-line;
}

.project-richtext {
    color: var(--muted);
    line-height: 1.62;
}

.project-richtext p {
    margin: 0;
}

.project-richtext p + p,
.project-richtext p + ul,
.project-richtext ul + p,
.project-richtext ul + ul,
.project-richtext h1 + p,
.project-richtext h2 + p,
.project-richtext p + h1,
.project-richtext p + h2,
.project-richtext ul + h1,
.project-richtext ul + h2,
.project-richtext h1 + ul,
.project-richtext h2 + ul {
    margin-top: 0.9rem;
}

.project-richtext ul {
    margin: 0;
    padding-left: 1.4rem;
}

.project-richtext h1,
.project-richtext h2 {
    margin: 0;
    color: var(--text);
    line-height: 1.25;
}

.project-richtext code {
    padding: 0.08rem 0.35rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.95em;
}

.project-richtext a {
    color: var(--accent);
}

.project-richtext li + li {
    margin-top: 0.35rem;
}

.project-link {
    display: inline-flex;
    margin-top: 14px;
    color: var(--project-accent);
    text-decoration: none;
    font-weight: 600;
}

.project-link:hover {
    text-decoration: underline;
}

.project-detail-layout {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    gap: 24px;
}

.compact-detail-header {
    padding-bottom: 10px;
}

.project-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: start;
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(170, 214, 150, 0.12), transparent 24%),
        linear-gradient(180deg, var(--card-top-gloss), transparent 24%),
        var(--card-bg);
    box-shadow: 0 18px 45px var(--card-shadow);
}

.project-hero-copy {
    display: grid;
    gap: 14px;
}

.project-meta-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.project-meta-chip {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, var(--card-top-gloss), transparent 30%),
        var(--card-bg);
    box-shadow: 0 10px 24px var(--card-shadow);
}

.project-meta-label {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.project-detail-card {
    display: grid;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(170, 214, 150, 0.1), transparent 22%),
        linear-gradient(180deg, var(--card-top-gloss), transparent 24%),
        var(--card-bg);
    box-shadow: 0 18px 45px var(--card-shadow);
}

.compact-card {
    gap: 14px;
}

.project-side-stack {
    display: grid;
    gap: 24px;
}

.project-detail-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
}

.project-detail-content {
    display: grid;
    gap: 18px;
}

.project-detail-summary,
.project-detail-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-line;
}

.project-detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.vertical-links {
    display: grid;
    gap: 10px;
}

.project-side-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.project-gallery-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
}

.project-type {
    display: inline-block;
    color: var(--accent);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-card-empty {
    border-style: dashed;
}

.dungeon-column {
    align-self: start;
}

.dungeon-frame {
    position: relative;
    display: grid;
    gap: 14px;
    justify-items: center;
    padding: 18px 18px 22px;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top, var(--dungeon-glow), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
        var(--dungeon-bg);
    box-shadow: 0 18px 45px var(--dungeon-shadow);
    overflow: hidden;
}

.dungeon-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 14%, rgba(155, 206, 141, 0.08), transparent 16%),
        radial-gradient(circle at 86% 18%, rgba(255, 191, 113, 0.08), transparent 14%),
        linear-gradient(180deg, transparent 0%, rgba(24, 43, 28, 0.08) 100%);
}

.dungeon-caption {
    width: 100%;
    display: grid;
    gap: 10px;
    text-align: center;
}

.dungeon-caption span {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
}

.player-stats-inline {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
}

.player-stats-inline-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.shop-modal,
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 75;
}

.confirm-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.confirm-overlay[hidden] {
    display: none !important;
}

.shop-modal-backdrop,
.confirm-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 8, 0.58);
    backdrop-filter: blur(4px);
}

.shop-modal-card,
.confirm-card {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 32px));
    margin: 12vh auto 0;
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 20px 42px var(--card-shadow);
}

.confirm-card {
    margin: 0;
}

.shop-modal-header,
.confirm-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shop-modal-title,
.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.shop-modal-subtitle,
.confirm-text {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.5;
}

.shop-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.shop-sell-panel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(216, 206, 119, 0.12);
}

.shop-sell-title {
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.shop-sell-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-sell-empty {
    color: var(--muted);
    font-size: 0.82rem;
}

.shop-item {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.shop-item-main {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.shop-item-body {
    display: grid;
    gap: 6px;
}

.shop-item-sprite {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 32px 32px;
    image-rendering: pixelated;
    box-shadow: 0 0 0 1px rgba(216, 206, 119, 0.14) inset;
}

.shop-item-sprite.is-animated-upgrade {
    animation: shop-upgrade-sprite-flip 0.5s steps(1) infinite;
}

.shop-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
}

.shop-item-description,
.shop-item-price {
    color: var(--muted);
}

.shop-item:hover {
    border-color: var(--accent);
}

.shop-item:disabled {
    opacity: 0.7;
    cursor: default;
}

.shop-item:disabled .shop-item-sprite.is-animated-upgrade {
    animation-play-state: paused;
}

@keyframes shop-upgrade-sprite-flip {
    0%, 49.999% {
        background-image: var(--shop-frame-a);
    }
    50%, 100% {
        background-image: var(--shop-frame-b);
    }
}

.shop-item-sprite.is-animated-upgrade {
    --shop-frame-a: none;
    --shop-frame-b: none;
}

.shop-item:disabled {
    opacity: 0.7;
    cursor: default;
}

.equipment-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: stretch;
    width: fit-content;
    max-width: calc(100vw - 48px);
    padding: 8px 10px;
    border: 1px solid rgba(216, 206, 119, 0.12);
    border-radius: 14px;
    background: rgba(14, 12, 19, 0.82);
    backdrop-filter: blur(4px);
    overflow-x: auto;
    overflow-y: hidden;
}

.equipment-strip-sticky {
    margin: 0;
}

.player-stats-inline-reset {
    pointer-events: auto;
}

.dungeon-caption small {
    color: var(--muted);
    line-height: 1.5;
}

.dungeon-grid-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    transition: height 220ms ease;
}

.equipment-slot {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(216, 206, 119, 0.16);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    display: grid;
    gap: 0;
    position: relative;
    overflow: hidden;
    align-content: center;
    justify-items: center;
}

.equipment-slot-square {
    aspect-ratio: 1 / 1;
}

.equipment-slot-square::before {
    content: "";
    position: absolute;
    inset: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
    opacity: 0.3;
    pointer-events: none;
}

.equipment-slot-weapon {
    border-color: rgba(214, 78, 78, 0.92);
    box-shadow: 0 0 0 1px rgba(214, 78, 78, 0.28) inset, 0 0 10px rgba(214, 78, 78, 0.16);
}

.equipment-slot-armor {
    border-color: rgba(214, 78, 78, 0.92);
    box-shadow: 0 0 0 1px rgba(214, 78, 78, 0.28) inset, 0 0 10px rgba(214, 78, 78, 0.16);
}

.equipment-slot-weapon::before {
    background-image: url('/static/core/sprites/tiles-3007.png');
}

.equipment-slot-armor::before {
    background-image: url('/static/core/sprites/tiles-2465.png');
}

.equipment-slot[style],
.inventory-slot[style] {
    background-position: center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
}

.equipment-slot-label,
.inventory-slot-type {
    color: var(--accent);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
}

.equipment-slot-value,
.inventory-slot-name,
.inventory-slot-empty {
    color: var(--text);
    font-size: 0.52rem;
    line-height: 1.05;
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    padding: 2px;
}

.inventory-slot-hotkey {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 0.58rem;
    line-height: 1;
    color: rgba(180, 180, 180, 0.55);
    pointer-events: none;
    text-align: center;
}

.inventory-slot[data-slot-index="0"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="1"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="2"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="3"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="4"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="5"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="6"] .inventory-slot-hotkey,
.inventory-slot[data-slot-index="7"] .inventory-slot-hotkey {
    display: flex;
}

.inventory-slot-name,
.equipment-slot-value {
    display: none;
}

.inventory-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.inventory-slot {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(216, 206, 119, 0.14);
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
    display: grid;
    gap: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
    align-content: center;
    justify-items: center;
    position: relative;
    overflow: hidden;
}

.inventory-slot:disabled {
    opacity: 0.7;
    cursor: default;
}

.inventory-slot.is-filled:hover {
    border-color: rgba(216, 206, 119, 0.34);
    background: rgba(216, 206, 119, 0.08);
}

.inventory-slot.is-upgrade {
    position: relative;
    border-color: rgba(90, 184, 255, 0.58);
    background: rgba(48, 90, 158, 0.18);
    animation: inventory-upgrade-glow 1.8s ease-in-out infinite;
}

.inventory-slot.is-upgrade-major {
    border-color: rgba(174, 124, 255, 0.72);
    background: rgba(93, 56, 170, 0.22);
    animation-duration: 1.2s;
}

.inventory-slot.item-tier-rare {
    box-shadow: 0 0 0 1px rgba(92, 186, 255, 0.24) inset, 0 0 10px rgba(92, 186, 255, 0.16);
}

.inventory-slot.item-tier-legendary {
    border-color: rgba(240, 193, 84, 0.72);
    background: rgba(120, 86, 24, 0.2);
    box-shadow: 0 0 0 1px rgba(240, 193, 84, 0.28) inset, 0 0 12px rgba(240, 193, 84, 0.2);
}

.inventory-slot.is-upgrade::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    padding: 2px;
    background: conic-gradient(
        from 0deg,
        rgba(120, 212, 255, 0.0) 0deg,
        rgba(120, 212, 255, 0.95) 70deg,
        rgba(120, 212, 255, 0.0) 140deg,
        rgba(120, 212, 255, 0.0) 360deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: inventory-upgrade-rotate 2.6s linear infinite;
}

.inventory-slot.is-upgrade-major::after {
    background: conic-gradient(
        from 0deg,
        rgba(214, 174, 255, 0.0) 0deg,
        rgba(214, 174, 255, 0.98) 70deg,
        rgba(214, 174, 255, 0.0) 140deg,
        rgba(214, 174, 255, 0.0) 360deg
    );
    animation-duration: 1.8s;
}

.dungeon-grid {
    position: relative;
    width: 384px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 32px);
    grid-auto-rows: 32px;
    border: 2px solid #332d3f;
    background: #0e0c13;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.04),
        0 0 0 6px rgba(14, 12, 19, 0.55);
}

.dungeon-objects,
.floating-text-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dungeon-object {
    position: absolute;
    width: 32px;
    height: 32px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 32px 32px;
    image-rendering: pixelated;
    z-index: 5;
}

.dungeon-object-monster {
    filter: drop-shadow(0 0 8px rgba(217, 77, 77, 0.35));
}

.dungeon-object-monster-elite {
    filter: drop-shadow(0 0 10px rgba(214, 124, 255, 0.42)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.12));
}

.dungeon-object-monster-boss {
    filter: drop-shadow(0 0 12px rgba(255, 170, 74, 0.52)) drop-shadow(0 0 5px rgba(255, 236, 184, 0.18));
}

.dungeon-object-item {
    filter: drop-shadow(0 0 8px rgba(142, 225, 136, 0.2));
}

.dungeon-object-item-rare {
    filter: drop-shadow(0 0 10px rgba(110, 196, 255, 0.42));
}

.dungeon-object-item-legendary {
    filter: drop-shadow(0 0 12px rgba(245, 202, 92, 0.5)) drop-shadow(0 0 4px rgba(255, 243, 196, 0.24));
}

.monster-health-bar {
    position: absolute;
    left: 3px;
    top: -6px;
    width: 26px;
    height: 4px;
    background: rgba(24, 8, 8, 0.72);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.monster-health-fill {
    width: 100%;
    height: 100%;
    background: #d63b3b;
    border-radius: 999px;
}

.inventory-tooltip {
    position: fixed;
    z-index: 80;
    max-width: 240px;
    padding: 8px 10px;
    border: 1px solid rgba(216, 206, 119, 0.24);
    border-radius: 10px;
    background: rgba(14, 12, 19, 0.96);
    color: #f7f3ff;
    font-size: 0.78rem;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.inventory-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.death-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
}

.death-overlay-card {
    position: fixed;
    min-width: 220px;
    max-width: 260px;
    padding: 14px 16px;
    border: 1px solid rgba(210, 98, 98, 0.42);
    border-radius: 14px;
    background: rgba(28, 14, 18, 0.96);
    color: #fff3f5;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
    pointer-events: auto;
}

.death-overlay-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.death-overlay-text {
    font-size: 0.82rem;
    color: rgba(255, 243, 245, 0.86);
    margin-bottom: 12px;
}

.death-overlay-button {
    width: 100%;
}

.floating-text {
    position: absolute;
    transform: translate(-50%, 0);
    color: #ffe48c;
    font-weight: 700;
    font-size: 0.82rem;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65), 0 0 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    animation: float-up 2.8s ease forwards;
    z-index: 8;
}

.floating-text-damage-enemy {
    color: #ffd7d7;
    text-shadow: 0 1px 0 rgba(65, 0, 0, 0.85), 0 0 12px rgba(255, 92, 92, 0.35);
}

.floating-text-damage-player {
    color: #ff6b6b;
    text-shadow: 0 1px 0 rgba(95, 0, 0, 0.92), 0 0 12px rgba(255, 74, 74, 0.42);
}

.combat-impact {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 7;
    animation: combat-impact-burst 0.5s ease-out forwards;
}

.combat-impact-enemy-hit {
    background: radial-gradient(circle, rgba(255, 220, 110, 0.95) 0%, rgba(255, 100, 80, 0.78) 42%, rgba(255, 100, 80, 0) 76%);
}

.combat-impact-player-hit {
    background: radial-gradient(circle, rgba(170, 220, 255, 0.95) 0%, rgba(125, 145, 255, 0.72) 42%, rgba(125, 145, 255, 0) 76%);
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translate(-50%, 0);
    }
    12% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -26px);
    }
}

@keyframes combat-impact-burst {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

@keyframes inventory-upgrade-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes inventory-upgrade-glow {
    0%, 100% {
        box-shadow: 0 0 7px rgba(82, 174, 255, 0.24), 0 0 0 1px rgba(90, 184, 255, 0.32) inset;
        border-color: rgba(90, 184, 255, 0.48);
    }
    50% {
        box-shadow: 0 0 12px rgba(82, 174, 255, 0.52), 0 0 0 1px rgba(146, 221, 255, 0.7) inset;
        border-color: rgba(146, 221, 255, 0.88);
    }
}

.tile {
    position: relative;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 32px 32px;
    image-rendering: pixelated;
}

.tile-hidden {
    filter: brightness(0.28);
}

.tile-targeted::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid rgba(180, 235, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(180, 235, 255, 0.35);
    pointer-events: none;
}

.dungeon-glow {
    position: absolute;
    left: 50%;
    width: 150px;
    height: 80px;
    transform: translateX(-50%);
    pointer-events: none;
    background: radial-gradient(circle, rgba(142, 225, 136, 0.17) 0%, rgba(142, 225, 136, 0.04) 42%, transparent 70%);
    filter: blur(8px);
}

.glow-top {
    top: 96px;
}

.glow-mid {
    top: 384px;
}

.glow-bottom {
    top: 672px;
}

.player {
    position: absolute;
    width: 32px;
    height: 32px;
    left: 0;
    top: 0;
    transition: transform 120ms steps(1);
    background: url('/static/core/sprites/player.png') center center / contain no-repeat;
    box-shadow: 0 0 10px rgba(216, 206, 119, 0.18);
    z-index: 5;
    image-rendering: pixelated;
}

.player::after {
    content: none;
}

.player.step-alt {
    filter: brightness(1.04);
}

.player.pulse {
    animation: tilePulse 160ms steps(1);
}

@keyframes tilePulse {
    0% { transform: translate(var(--x, 0), var(--y, 0)) scale(1); }
    50% { transform: translate(var(--x, 0), var(--y, 0)) scale(1.04); }
    100% { transform: translate(var(--x, 0), var(--y, 0)) scale(1); }
}

@media (max-width: 1180px) {
    .event-left {
        transform: translate(-58%, calc(var(--event-top) * 1px));
    }

    .event-right {
        transform: translate(58%, calc(var(--event-top) * 1px));
    }
}

@media (max-width: 1080px) {
    .home-layout {
        grid-template-columns: 1fr;
        padding-left: 16px;
        padding-right: 16px;
    }

    .project-column {
        display: grid;
    }

    .project-hero-card,
    .project-detail-grid {
        grid-template-columns: 1fr;
    }

    .dungeon-column {
        position: relative;
        top: 0;
        order: -1;
        width: 100%;
        min-width: 0;
    }

    .site-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        margin-left: 0;
    }

    .dungeon-frame {
        overflow-x: hidden;
        padding-left: 12px;
        padding-right: 12px;
    }

    .dungeon-grid-wrap {
        min-width: 0;
        width: 100%;
        justify-content: center;
        padding: 0;
        overflow-x: hidden;
    }

    .dungeon-grid {
        width: min(384px, calc(100vw - 56px));
        max-width: 100%;
        transform-origin: top center;
    }

    .equipment-strip,
    .equipment-strip-sticky {
        grid-template-columns: repeat(5, 32px);
    }

    .inventory-grid {
        grid-template-columns: repeat(5, 32px);
        grid-column: 1 / -1;
    }
}


@media (max-width: 760px) {
    .dungeon-frame {
        padding-left: 6px;
        padding-right: 6px;
    }

    .dungeon-grid {
        width: 384px;
        max-width: none;
        transform: none;
        margin-top: 0;
        margin-bottom: 0;
        margin-left: -16px;
    }

    .dungeon-grid-wrap {
        min-width: 0;
        padding: 0;
    }

    .player-stats-panel {
        padding: 7px 8px 8px;
        gap: 8px;
    }

    .player-stats-panel-top {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .player-stats-line {
        padding: 6px 8px;
        font-size: 0.68rem;
        letter-spacing: 0.04em;
        max-width: min(100%, 52vw);
    }

    .player-stats-shop,
    .player-stats-reset {
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .equipment-strip,
    .equipment-strip-sticky {
        gap: 5px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 5px 2px;
    }

    .equipment-slot,
    .inventory-slot {
        flex: 0 0 26px;
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .equipment-slot[style],
    .inventory-slot[style] {
        background-size: 18px 18px;
    }

    .inventory-slot-hotkey {
        font-size: 0.5rem;
    }
}


@media (max-width: 640px) {
    .player-stats-panel {
        max-width: calc(100vw - 16px);
        padding-left: 8px;
        padding-right: 8px;
        width: calc(100vw - 16px);
    }

    .equipment-strip {
        max-width: calc(100vw - 32px);
    }

    .player-stats-panel-top {
        flex-wrap: nowrap;
    }

    .shop-modal-card {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin-top: 0;
    }
}


.site-footer {
    max-width: 1320px;
    margin: 48px auto 0;
    padding: 0 24px 40px;
}

.site-footer-divider {
    border: 0;
    height: 1px;
    margin: 0 0 18px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(142, 225, 136, 0.95), rgba(0, 0, 0, 0));
}

.site-imprint {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.6;
    text-align: center;
}


.combat-debug-log {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 75;
    width: min(420px, calc(100vw - 28px));
    max-height: 42vh;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid rgba(216, 206, 119, 0.22);
    border-radius: 14px;
    background: rgba(14, 12, 19, 0.92);
    color: #f7f3ff;
    font-size: 0.74rem;
    line-height: 1.45;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.combat-debug-log[hidden] {
    display: none !important;
    pointer-events: none;
}

.combat-debug-entry + .combat-debug-entry {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}


.project-gallery-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
}

.gallery-lightbox[hidden] {
    display: none !important;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 7, 12, 0.86);
    cursor: pointer;
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 1180px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.gallery-lightbox-figure {
    margin: 0;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.gallery-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.gallery-lightbox-caption {
    color: #f3f0ff;
    text-align: center;
    font-size: 0.86rem;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 16, 23, 0.84);
    color: #f3f0ff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.gallery-lightbox-close {
    position: absolute;
    top: -18px;
    right: -6px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 1.6rem;
    line-height: 1;
}

.gallery-lightbox-nav {
    width: 44px;
    height: 72px;
    border-radius: 12px;
    font-size: 2rem;
    line-height: 1;
}

body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .gallery-lightbox-dialog {
        width: min(96vw, 1180px);
        grid-template-columns: 1fr;
    }

    .gallery-lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        height: 56px;
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }

    .gallery-lightbox-close {
        top: 8px;
        right: 8px;
    }
}
