@font-face {
    font-family: Mansalva;
    src: url("fonts/Mansalva-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --game-primary: #c90c0f;
    --game-secondary: #d6dea7;
}

body.lz-page {
    margin: 0;
    min-height: 100vh;
    background: #140f08;
    color: #f6edd8;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

body.lz-page.game-menu-active {
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 18% 0%, rgba(214, 222, 167, 0.2), transparent 42%),
        linear-gradient(180deg, #2a220f 0%, #141006 70%);
}

body.lz-page.game-menu-active #game-header {
    display: none !important;
}

body.lz-page.lz-playing {
    overflow: hidden;
    height: 100%;
}

.lz-page .game-screen {
    display: none;
}

.lz-page .game-screen.active {
    display: block;
}

.lz-chrome {
    display: none;
    position: fixed;
    z-index: 11650;
    left: 0.8rem;
    bottom: 0.8rem;
    gap: 0.4rem;
}

body.lz-playing .lz-chrome {
    display: flex;
}

body.lz-playing:has(#lzOpening:not([hidden])) .lz-chrome {
    display: none;
}

.lz-chrome-btn {
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    border: 2px solid #d6dea7;
    background: #2c2418;
    color: #f6edd4 !important;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.lz-chrome-btn:hover,
.lz-chrome-btn:focus-visible {
    background: #3d3424;
    color: #fff !important;
    border-color: #fff6d8;
}

body.lz-coarse .lz-chrome {
    left: 50%;
    bottom: 9.5rem;
    transform: translateX(-50%);
}

.lz-stage {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    background: #100e08;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.lz-view {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.lz-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 42%, rgba(12, 9, 4, 0.55) 100%),
        linear-gradient(180deg, rgba(255, 244, 210, 0.05), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.28));
}

.lz-crosshair {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.lz-crosshair::before,
.lz-crosshair::after {
    content: "";
    position: absolute;
    background: rgba(20, 14, 6, 0.85);
    box-shadow: 0 0 0 1px rgba(246, 236, 196, 0.85);
}

.lz-crosshair::before {
    left: 8px;
    top: 2px;
    width: 2px;
    height: 14px;
}

.lz-crosshair::after {
    left: 2px;
    top: 8px;
    width: 14px;
    height: 2px;
}

.lz-hud {
    position: absolute;
    top: 0.7rem;
    left: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    z-index: 3;
    pointer-events: none;
}

.lz-hud span {
    background: rgba(18, 14, 8, 0.78);
    color: #f6edd4;
    border: 1px solid rgba(246, 237, 212, 0.28);
    border-radius: 6px;
    padding: 0.28rem 0.55rem;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}

.lz-minimap {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 132px;
    height: 132px;
    border: 1px solid rgba(246, 237, 212, 0.35);
    border-radius: 8px;
    background: rgba(12, 10, 6, 0.72);
    z-index: 3;
    pointer-events: none;
}

body.lz-no-map .lz-minimap {
    display: none;
}

@media (max-width: 700px) {
    .lz-hud {
        max-width: calc(100% - 6.2rem);
    }

    .lz-minimap {
        top: 2.8rem;
        width: 84px;
        height: 84px;
    }

    body.lz-playing .lz-minimap {
        top: 4.6rem;
    }
}

.lz-prompt,
.lz-toast,
.lz-fadehint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    color: #f8f1dc;
    background: rgba(18, 14, 8, 0.78);
    border: 1px solid rgba(246, 237, 212, 0.28);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.92rem;
    text-align: center;
    max-width: calc(100% - 2rem);
}

.lz-prompt { bottom: 1.3rem; }
.lz-toast { top: 3.2rem; }
.lz-fadehint {
    bottom: 4.2rem;
    transition: opacity 0.6s ease;
}

.lz-fadehint.lz-gone {
    opacity: 0;
}

.lz-prompt[hidden],
.lz-toast[hidden],
.lz-fadehint[hidden] {
    display: none !important;
}

.lz-puzzle,
.lz-win {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -48%);
    width: min(440px, calc(100% - 1.25rem));
    max-height: calc(100% - 1.25rem);
    overflow: auto;
    z-index: 6;
    background: #e7e6c2;
    color: #24180c;
    border: 1px solid #c3cb6e;
    border-radius: 4px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    padding: 1rem 1.05rem 0.95rem;
}

.lz-puzzle[hidden],
.lz-win[hidden] {
    display: none !important;
}

.lz-kicker {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7a5a28;
    font-weight: 700;
}

.lz-puzzle h2,
.lz-win h2 {
    margin: 0.35rem 0 0.75rem;
    font-size: 1.28rem;
    line-height: 1.35;
    color: #24180c;
    font-weight: 700;
}

.lz-answer {
    width: 100%;
    box-sizing: border-box;
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 2px solid #6e5428;
    background: #fffaf0;
    color: #24180c;
    margin-bottom: 0.7rem;
}

.lz-answer:focus {
    outline: 3px solid #9f1d18;
    outline-offset: 1px;
}

.lz-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.lz-key,
.lz-text-btn,
.lz-submit {
    min-height: 46px;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
}

.lz-key {
    background: #2c2418;
    color: #f6edd4;
    border: 0;
}

.lz-space {
    grid-column: 1 / -1;
}

.lz-code-order[hidden] {
    display: none;
}

.lz-code-order {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.15rem 0.25rem;
    margin: 0 0 0.85rem;
    padding: 0.35rem 0.45rem;
    background: #d6dea7;
    border: 2px solid #24180c;
    border-radius: 8px;
}

.lz-code-sketch {
    width: 52px;
    height: 52px;
    display: block;
    background: transparent;
}

.lz-code-sep {
    width: 22px;
    height: 34px;
    display: block;
    background: transparent;
}

.lz-code-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}

.lz-code-tag,
.lz-code-op {
    color: #24180c;
    font-weight: 800;
    line-height: 1;
}

.lz-code-tag {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

.lz-code-op {
    font-size: 1.15rem;
    padding: 0 0.12rem;
}

.lz-hud span.lz-lives-low {
    color: #ffd0c4;
    border-color: rgba(255, 190, 170, 0.75);
}

.lz-key:hover,
.lz-key:focus-visible {
    background: #433628;
    color: #fff8e6;
}

.lz-puzzle-actions,
.lz-win-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.lz-text-btn,
.lz-submit {
    flex: 1 1 120px;
    border: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
}

.lz-text-btn {
    background: #fffaf0;
    color: #24180c;
    border: 2px solid #24180c;
}

.lz-text-btn:hover,
.lz-text-btn:focus-visible {
    background: #24180c;
    color: #f6edd4;
}

.lz-submit {
    background: #9f1d18;
    color: #ffffff;
}

.lz-submit:hover,
.lz-submit:focus-visible {
    background: #7e1511;
    color: #ffffff;
}

.lz-hint-line,
.lz-msg {
    min-height: 1.2rem;
    margin: 0.55rem 0 0;
    color: #5c4520;
    font-size: 0.92rem;
}

.lz-msg {
    color: #9f1d18;
    font-weight: 700;
}

.lz-puzzle.lz-shake {
    animation: lz-shake 0.28s linear;
}

@keyframes lz-shake {
    0%, 100% { transform: translate(-50%, -48%); }
    25% { transform: translate(calc(-50% - 7px), -48%); }
    75% { transform: translate(calc(-50% + 7px), -48%); }
}

.lz-touch {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0.75rem 0.85rem max(0.85rem, env(safe-area-inset-bottom));
    pointer-events: none;
}

body.lz-coarse .lz-touch {
    display: flex;
}

body.lz-coarse .lz-prompt {
    bottom: 8.2rem;
}

body.lz-coarse .lz-fadehint {
    bottom: 11rem;
}

.lz-stick {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: rgba(18, 14, 8, 0.4);
    border: 2px solid rgba(244, 226, 176, 0.7);
    position: relative;
    pointer-events: auto;
}

.lz-knob {
    position: absolute;
    width: 48px;
    height: 48px;
    left: 50%;
    top: 50%;
    margin: -24px 0 0 -24px;
    border-radius: 50%;
    background: #f3e2b0;
    border: 2px solid #24180c;
}

.lz-door-btn {
    pointer-events: auto;
    min-width: 108px;
    min-height: 56px;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background: #f3e2b0;
    color: #24180c;
    border: 2px solid #24180c;
    font-weight: 800;
    font-size: 1rem;
}

.lz-door-btn:hover,
.lz-door-btn:focus-visible {
    background: #fff6d8;
    color: #24180c;
}

.lz-page .modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(8, 6, 3, 0.72);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lz-page .modal.active {
    display: flex;
}

.lz-page .modal-content {
    width: min(640px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    background: #f7f0df;
    color: #24180c;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.lz-page .modal-header,
.lz-page .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
}

.lz-page .modal-header {
    border-bottom: 1px solid #d6dea7;
}

.lz-page .modal-header h2 {
    margin: 0;
    color: #9f1d18;
    font-size: 1.3rem;
}

.lz-page .modal-close {
    background: #fffaf0;
    color: #24180c;
    border: 2px solid #24180c;
    border-radius: 8px;
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
}

.lz-page .modal-close:hover,
.lz-page .modal-close:focus-visible {
    background: #24180c;
    color: #f6edd4;
}

.lz-page .modal-body {
    padding: 1rem 1.15rem 1.15rem;
    line-height: 1.5;
}

.lz-page .modal-body p,
.lz-page .modal-body li {
    color: #24180c;
}

.lz-page .modal-footer {
    border-top: 1px solid #d6dea7;
    justify-content: flex-end;
}

.lz-page .btn {
    min-height: 44px;
    border-radius: 8px;
    border: 0;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.lz-page .btn-primary {
    background: #9f1d18;
    color: #ffffff;
}

.lz-page .btn-primary:hover,
.lz-page .btn-primary:focus-visible {
    background: #7e1511;
    color: #ffffff;
}

.lz-page .btn-secondary {
    background: #4a3c28;
    color: #ffffff;
}

.lz-page .btn-secondary:hover,
.lz-page .btn-secondary:focus-visible {
    background: #2e2618;
    color: #ffffff;
}

.lz-diff {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.lz-page .difficulty-pill {
    background: #fffaf0;
    color: #24180c;
    border: 2px solid #9f1d18;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.lz-page .difficulty-pill.active,
.lz-page .difficulty-pill:hover,
.lz-page .difficulty-pill:focus-visible {
    background: #9f1d18;
    color: #ffffff;
}

.lz-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.8rem 0 0;
    color: #24180c;
    font-weight: 600;
}

.lz-check input {
    width: 1.1rem;
    height: 1.1rem;
}

.lz-range {
    width: 100%;
    accent-color: #9f1d18;
}

.lz-note {
    color: #5c4520;
    font-size: 0.92rem;
}

.lz-stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lz-stats-list li {
    background: #fffaf0;
    border: 1px solid #d6dea7;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
}

.lz-stats-list strong {
    display: block;
    font-size: 1.2rem;
    color: #24180c;
}

.lz-help-list {
    margin: 0.4rem 0 0;
    padding-left: 1.15rem;
}

.lz-opening {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: #000;
}

.lz-opening[hidden] {
    display: none !important;
}

.lz-opening-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.lz-desk {
    position: absolute;
    overflow: visible;
    pointer-events: none;
}

.lz-desk-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.lz-desk-map polygon {
    fill: none;
    stroke: none;
}

.lz-desk-slot {
    position: absolute;
    transform: translate(-50%, -50%);
}

.lz-opening-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.4rem 1rem 1.4rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

.lz-opening-bar .lz-text-btn,
.lz-opening-bar .lz-submit {
    flex: 0 0 auto;
    min-width: 8.5rem;
}

.lz-opening-bar .lz-text-btn {
    background: #2c2418;
    color: #f6edd4;
    border: 2px solid #d6dea7;
}

.lz-opening-bar .lz-text-btn:hover,
.lz-opening-bar .lz-text-btn:focus-visible {
    background: #d6dea7;
    color: #24180c !important;
}

.lz-opening-bar .lz-submit {
    background: #C90C0F;
    color: #fff;
}

.lz-opening-bar .lz-submit:hover,
.lz-opening-bar .lz-submit:focus-visible {
    background: #9a090c;
    color: #fff;
}

.lz-floppy-cue {
    position: absolute;
    left: 15%;
    top: 50%;
    width: 15%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    z-index: 4;
    image-rendering: pixelated;
}

.lz-floppy-cue canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.lz-floppy-cue:focus-visible {
    outline: 3px solid #f6edd4;
    outline-offset: 3px;
}

.lz-sort {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.lz-sort[hidden] {
    display: none !important;
}

.lz-sort-wood {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.lz-postit {
    position: absolute;
    left: 3%;
    top: 4%;
    z-index: 2;
    width: min(42vw, 340px);
    margin: 0;
    transform: rotate(-4deg);
    filter: drop-shadow(4px 6px 0 rgba(36, 24, 12, 0.28));
    pointer-events: none;
}

.lz-postit img {
    display: block;
    width: 100%;
    height: auto;
}

.lz-note-text {
    position: absolute;
    left: 14%;
    right: 14%;
    top: 46%;
    margin: 0;
    transform: translateY(-50%);
    color: #24180c;
    font-family: "Nothing You Could Do", cursive;
    font-size: clamp(1.35rem, 2.6vw, 2.05rem);
    line-height: 1.15;
    text-align: center;
}

.lz-leave {
    position: absolute;
    left: 86%;
    top: 62%;
    z-index: 4;
    width: auto;
    min-width: 8.2rem;
    min-height: 3.4rem;
    padding: 0.55rem 0.9rem;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(3deg);
    background: #f3e27a;
    color: #24180c !important;
    border: 3px dashed #24180c;
    border-radius: 6px;
    font-family: "Nothing You Could Do", cursive;
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    line-height: 1.05;
    cursor: pointer;
}

.lz-leave:hover,
.lz-leave:focus-visible {
    background: #ffe98a;
    color: #24180c !important;
}

.lz-leave.is-armed,
.lz-leave.is-armed:hover,
.lz-leave.is-armed:focus-visible {
    background: #24180c;
    color: #f6edd4 !important;
    border-style: solid;
}

.lz-leave.is-hint {
    animation: lz-leave-hint 0.55s ease 2;
}

.lz-leave:focus-visible {
    outline: 3px solid #24180c;
    outline-offset: 3px;
}

.lz-leave.is-armed:focus-visible {
    outline-color: #f6edd4;
}

.lz-sort-slots,
.lz-floppies {
    position: absolute;
    inset: 0;
}

.lz-sort-slot {
    position: absolute;
    width: min(14vw, 150px);
    aspect-ratio: 1;
    border: 3px dashed rgba(36, 24, 12, 0.45);
    border-radius: 8px;
    transform: translate(-50%, -50%);
}

.lz-floppy {
    position: absolute;
    width: min(16vw, 176px);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 3;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
    transition: left 0.35s ease, top 0.35s ease, transform 0.35s ease;
}

.lz-floppy img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.lz-floppy:focus-visible {
    outline: 3px solid #24180c;
    outline-offset: 3px;
}

.lz-floppy.is-sorted,
.lz-floppy.is-out {
    z-index: 5;
}

.lz-floppy.is-sorted {
    --rot: 0deg;
}

.lz-floppy.is-out {
    width: min(10vw, 108px);
    pointer-events: none;
}

.lz-floppy.is-no {
    animation: lz-floppy-no 0.34s ease;
}

.lz-opening.is-glitch {
    animation: lz-open-glitch 0.7s steps(1, end) forwards;
}

.lz-opening.is-black {
    background: #000;
}

.lz-opening.is-black .lz-opening-photo,
.lz-opening.is-black .lz-desk,
.lz-opening.is-black .lz-sort,
.lz-opening.is-black .lz-opening-bar {
    opacity: 0;
}

.lz-opening.is-fade {
    opacity: 0;
    transition: opacity 1.15s ease;
}

@keyframes lz-leave-hint {
    50% { transform: translate(-50%, -50%) rotate(3deg) scale(1.08); }
}

@keyframes lz-floppy-no {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
    35% { transform: translate(calc(-50% - 10px), -50%) rotate(var(--rot, 0deg)); }
    70% { transform: translate(calc(-50% + 10px), -50%) rotate(var(--rot, 0deg)); }
}

@keyframes lz-open-glitch {
    0% { transform: none; filter: none; }
    12% { transform: translate(-12px, 3px); filter: hue-rotate(80deg) contrast(1.5); }
    24% { transform: translate(14px, -6px); filter: saturate(4); }
    40% { transform: translate(-8px, 0); clip-path: inset(18% 0 46% 0); }
    55% { transform: translate(10px, 4px); filter: invert(1); clip-path: none; }
    72% { transform: translate(-16px, 2px); clip-path: inset(42% 0 12% 0); filter: contrast(1.8); }
    100% { transform: none; filter: brightness(0); clip-path: none; }
}

.lz-ending {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: #000;
    opacity: 0;
}

.lz-ending[hidden] {
    display: none !important;
}

.lz-ending.is-in {
    opacity: 1;
    transition: opacity 1.2s ease;
}

.lz-ending-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    display: block;
}

.lz-ending.is-photo .lz-ending-photo {
    opacity: 1;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.25) 12%, #000 28%, #000 72%, rgba(0, 0, 0, 0.25) 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.25) 12%, #000 28%, #000 72%, rgba(0, 0, 0, 0.25) 88%, transparent 100%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 1.5%;
    mask-size: 100% 1.5%;
    animation: lz-eyes-open 2.2s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.lz-vhs {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    color: #f3f0d8;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    text-shadow:
        1px 0 0 rgba(255, 48, 48, 0.55),
        -1px 0 0 rgba(70, 210, 255, 0.45),
        0 1px 0 #000,
        0 -1px 0 #000;
}

.lz-ending.is-photo .lz-vhs {
    opacity: 1;
}

.lz-vhs-live {
    position: fixed;
    z-index: 11200;
    opacity: 1;
}

.lz-vhs-live[hidden] {
    display: none !important;
}

body.lz-playing .lz-hud,
body.lz-playing .lz-minimap {
    top: 4.6rem;
}

.lz-puzzle {
    z-index: 11600;
}

.lz-vhs-scan {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.42) 100%),
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 4px);
}

.lz-vhs-frame {
    position: absolute;
    inset: 0.85rem;
    background:
        linear-gradient(#f3f0d8, #f3f0d8) left top / 34px 3px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) left top / 3px 34px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) right top / 34px 3px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) right top / 3px 34px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) left bottom / 34px 3px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) left bottom / 3px 34px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) right bottom / 34px 3px no-repeat,
        linear-gradient(#f3f0d8, #f3f0d8) right bottom / 3px 34px no-repeat;
}

.lz-vhs-rec {
    position: absolute;
    top: 1.35rem;
    left: 1.55rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.45rem;
    letter-spacing: 0.16em;
    animation: lz-rec 1.1s steps(1, end) infinite;
}

.lz-vhs-dot {
    width: 0.78rem;
    height: 0.78rem;
    border-radius: 50%;
    background: #ff2a2a;
    box-shadow: 0 0 10px #ff2a2a;
}

.lz-vhs-stamp {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.lz-vhs-battery {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 1px;
    box-sizing: border-box;
    width: 2.15rem;
    height: 0.78rem;
    margin-bottom: 0.2rem;
    padding: 2px;
    border: 2px solid #f3f0d8;
    border-radius: 2px;
    box-shadow: 1px 0 0 rgba(255, 48, 48, 0.45), -1px 0 0 rgba(70, 210, 255, 0.35);
}

.lz-vhs-battery > span {
    flex: 1 1 0;
    border-radius: 1px;
    background: transparent;
}

.lz-vhs-battery[data-bars="1"] > span:nth-child(-n + 1),
.lz-vhs-battery[data-bars="2"] > span:nth-child(-n + 2),
.lz-vhs-battery[data-bars="3"] > span:nth-child(-n + 3),
.lz-vhs-battery[data-bars="4"] > span:nth-child(-n + 4) {
    background: #f3f0d8;
}

.lz-vhs-battery::before {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    width: 3px;
    height: 0.32rem;
    background: #f3f0d8;
    transform: translateY(-50%);
}

.lz-vhs-battery.is-critical > span:first-child {
    animation: lz-battery-blink 1.4s steps(1, end) infinite;
}

body.lz-low-flicker .lz-vhs-battery.is-critical > span:first-child {
    animation: none;
    opacity: 1;
}

@keyframes lz-rec {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0.12; }
}

@keyframes lz-battery-blink {
    0%, 46% { opacity: 1; }
    47%, 100% { opacity: 0.12; }
}

@keyframes lz-eyes-open {
    0% {
        -webkit-mask-size: 100% 1.2%;
        mask-size: 100% 1.2%;
    }
    28% {
        -webkit-mask-size: 100% 7%;
        mask-size: 100% 7%;
    }
    100% {
        -webkit-mask-size: 100% 220%;
        mask-size: 100% 220%;
    }
}

.lz-ending .lz-win {
    top: auto;
    bottom: 1.15rem;
    transform: translateX(-50%);
    width: min(520px, calc(100% - 1.5rem));
    background: rgba(16, 12, 8, 0.9);
    color: #f6edd4;
    border: 1px solid rgba(214, 222, 167, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    opacity: 0;
}

.lz-ending.is-result .lz-win {
    opacity: 1;
    transition: opacity 0.7s ease;
}

.lz-ending .lz-kicker {
    color: #d6dea7;
}

.lz-ending .lz-win h2,
.lz-ending .lz-win p {
    color: #f6edd4;
}

.lz-ending .lz-text-btn {
    background: #2c2418;
    color: #f6edd4;
    border: 2px solid #d6dea7;
}

.lz-ending .lz-text-btn:hover,
.lz-ending .lz-text-btn:focus-visible {
    background: #d6dea7;
    color: #24180c !important;
}

.lz-ending .lz-submit {
    background: #C90C0F;
    color: #fff;
}

.lz-ending .lz-submit:hover,
.lz-ending .lz-submit:focus-visible {
    background: #9a0a0c;
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .lz-puzzle.lz-shake {
        animation: none;
    }

    .lz-ending,
    .lz-ending-photo,
    .lz-ending .lz-win {
        transition: none;
    }

    .lz-ending.is-photo .lz-ending-photo {
        animation: none;
        opacity: 1;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .lz-vhs-rec,
    .lz-vhs-battery.is-critical > span:first-child {
        animation: none;
        opacity: 1;
    }

    .lz-opening.is-glitch,
    body.lz-low-flicker .lz-opening.is-glitch {
        animation: none;
    }

    .lz-floppy,
    .lz-leave.is-hint,
    .lz-floppy.is-no {
        transition: none;
        animation: none;
    }
}

@media (max-width: 700px) {
    .lz-vhs-rec {
        top: 0.85rem;
        left: 0.9rem;
        font-size: 1.05rem;
    }

    .lz-vhs-stamp {
        top: 0.75rem;
        right: 0.85rem;
        font-size: 0.95rem;
    }

    .lz-vhs-frame {
        inset: 0.45rem;
    }
}
