@font-face {
    font-family: "Big Shoulders Display";
    src: url("../fonts/big-shoulders-display-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --void: #050303;
    --phosphor: #8d9774;
    --bone: #c2b29a;
    --gold: #8d6b3e;
    --blood: #8e1c22;
    --blood-deep: #3d080c;
    --ash: #6e655c;
    --split: 0px;
    --slice: 0px;
    --level: 0;
    color-scheme: dark;
}

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

html,
body {
    margin: 0;
    height: 100%;
    background: var(--void);
    color: var(--bone);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}

html:not(.js) #app {
    display: none;
}

body {
    overflow: hidden;
    cursor: crosshair;
}

button,
a {
    cursor: crosshair;
}

::selection {
    background: var(--blood);
    color: var(--bone);
}

.curse {
    position: relative;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 12% 84%, rgba(74, 8, 12, 0.72), transparent 46%),
        radial-gradient(ellipse at 86% 12%, rgba(42, 6, 8, 0.55), transparent 38%),
        radial-gradient(ellipse at 48% 42%, transparent 10%, #000 74%),
        var(--void);
    user-select: none;
}

.curse[data-corrupt="1"] { --split: 1px; --slice: 4px; --level: 1; }
.curse[data-corrupt="2"] { --split: 2px; --slice: 8px; --level: 2; }
.curse[data-corrupt="3"] { --split: 3px; --slice: 12px; --level: 3; }
.curse[data-corrupt="4"] { --split: 5px; --slice: 16px; --level: 4; }
.curse[data-corrupt="5"] { --split: 7px; --slice: 22px; --level: 5; }
.curse[data-corrupt="6"] { --split: 9px; --slice: 28px; --level: 6; }

.noise,
.scanlines,
.scratches,
.stain,
.vignette,
.slices,
.bezel,
.sigil {
    pointer-events: none;
}

.scratches {
    position: fixed;
    inset: 0;
    z-index: 5;
    background:
        repeating-linear-gradient(97deg, transparent 0 22px, rgba(194, 178, 154, 0.035) 22px 23px),
        repeating-linear-gradient(-14deg, transparent 0 47px, rgba(90, 12, 16, 0.07) 47px 48px);
}

.stain {
    position: absolute;
    z-index: 1;
    background: radial-gradient(ellipse, rgba(74, 8, 12, 0.8), transparent 68%);
    filter: blur(10px);
}

.stain-a {
    width: 34vw;
    height: 22vh;
    left: -6vw;
    bottom: 6vh;
    transform: rotate(-12deg);
}

.stain-b {
    width: 22vw;
    height: 28vh;
    right: 2vw;
    top: 8vh;
    opacity: 0.55;
}

.stain-c {
    width: 10vw;
    height: 46vh;
    left: 11vw;
    top: 18vh;
    opacity: 0.35;
    border-radius: 40% 60% 70% 30%;
}

.noise {
    position: fixed;
    inset: -30%;
    z-index: 5;
    opacity: 0.34;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: overlay;
    animation: grain 0.45s steps(2, end) infinite;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 6;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.45) 0px,
        rgba(0, 0, 0, 0.45) 1px,
        transparent 1px,
        transparent 4px
    );
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 6;
    background: radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, 0.88) 100%);
}

.curse[data-corrupt="6"] .vignette {
    background:
        radial-gradient(ellipse at center, transparent 28%, rgba(90, 0, 8, 0.38) 100%),
        radial-gradient(ellipse at center, transparent 46%, rgba(0, 0, 0, 0.8) 100%);
}

.slices {
    position: fixed;
    inset: 0;
    z-index: 5;
    opacity: calc(var(--level) * 0.12);
}

.slices i {
    position: absolute;
    left: -6%;
    width: 112%;
    height: 7px;
    background: var(--blood-deep);
}

.slices i:nth-child(1) { top: 22%; animation: rift 2.8s steps(2, end) infinite; }
.slices i:nth-child(2) { top: 51%; animation: rift 3.3s steps(2, end) infinite reverse; }
.slices i:nth-child(3) { top: 74%; animation: rift 2.5s steps(2, end) infinite; }

.bezel {
    position: fixed;
    inset: 14px;
    z-index: 7;
    background:
        linear-gradient(#6a1418, #6a1418) left 8px top / 46px 1px no-repeat,
        linear-gradient(#6a1418, #6a1418) left top 10px / 1px 54px no-repeat,
        linear-gradient(#3c3430, #3c3430) right 18px top / 22px 1px no-repeat,
        linear-gradient(#6a1418, #6a1418) left 4px bottom / 18px 1px no-repeat,
        linear-gradient(#6a1418, #6a1418) left bottom 6px / 1px 36px no-repeat,
        linear-gradient(#8d6b3e, #8d6b3e) right 6px bottom / 52px 1px no-repeat,
        linear-gradient(#8d6b3e, #8d6b3e) right bottom 12px / 1px 24px no-repeat;
}

.bezel-id,
.bezel-seal {
    position: absolute;
    background: var(--void);
    color: var(--bone);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    padding: 0 0.45rem;
}

.bezel-id {
    top: -0.5rem;
    left: 0.85rem;
}

.bezel-seal {
    right: 0.85rem;
    bottom: -0.5rem;
    color: var(--blood);
}

.sigil {
    position: fixed;
    top: 1.35rem;
    right: 1.45rem;
    width: 42px;
    height: 42px;
    z-index: 8;
    opacity: 0.9;
}

.stage,
.still,
.fallback {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 8vw 12vh;
}

.stage {
    flex-direction: column;
    animation: lamp 5.6s infinite;
}

.curse[data-phase="post"] .stage {
    align-items: flex-start;
    justify-content: flex-start;
}

.curse[data-phase="liturgy"] .readout {
    width: min(40rem, 100%);
}

.leave {
    white-space: nowrap;
}

.curse[data-corrupt="4"] .stage,
.curse[data-corrupt="5"] .stage,
.curse[data-corrupt="6"] .stage {
    transform: skewX(-0.35deg);
}

.readout {
    width: min(920px, 100%);
    margin: 0;
}

.readout p {
    margin: 0;
}

.phosphor {
    align-self: flex-start;
    color: var(--phosphor);
    font-size: clamp(0.92rem, 1.7vw, 1.12rem);
    line-height: 1.7;
    letter-spacing: 0.04em;
    text-shadow: 0 0 6px rgba(141, 151, 116, 0.25);
}

.judgment {
    text-align: center;
    color: var(--bone);
    font-family: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 4.6vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: 0.045em;
    text-shadow: calc(var(--split) * 0.4) 0 var(--blood-deep);
}

.judgment p + p {
    margin-top: 0.35rem;
}

.rule {
    height: 2px;
    margin: 0.9rem auto !important;
    width: min(16rem, 60%);
    background: var(--blood);
    box-shadow: 0 0 12px rgba(193, 18, 31, 0.7);
}

.liturgy {
    color: rgba(194, 178, 154, 0.78);
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    line-height: 1.65;
    letter-spacing: 0.02em;
    text-shadow: 0 0 0 transparent;
}

.sentence,
.still,
.fallback {
    flex-direction: column;
    text-align: center;
}

.kicker {
    position: relative;
    z-index: 2;
    margin: 0 0 0.85rem;
    color: var(--blood);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.38em;
}

.leave {
    position: relative;
    display: inline-block;
    margin: 0;
    color: var(--bone);
    font-family: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    font-weight: 800;
    font-size: clamp(5.6rem, 20vw, 16rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    transform: rotate(-1.6deg) skewX(-2deg);
    text-shadow:
        0.03em 0.08em 0.04em var(--blood-deep),
        -0.02em 0.01em 0 rgba(90, 12, 16, 0.9),
        calc(var(--split) * -0.35) 0.01em 0 var(--blood);
}

.leave::before,
.leave::after {
    content: "LEAVE";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    pointer-events: none;
    overflow: hidden;
}

.leave::before {
    color: #6a1016;
    clip-path: polygon(
        0 34%, 9% 46%, 21% 31%, 37% 52%, 52% 37%,
        66% 55%, 81% 39%, 100% 48%, 100% 63%,
        84% 74%, 69% 57%, 51% 78%, 36% 61%,
        19% 80%, 7% 64%, 0 72%
    );
    opacity: 0.92;
    animation: rift-a 3.4s steps(2, end) infinite;
}

.leave::after {
    color: #2a0608;
    left: 0.03em;
    top: 0.05em;
    clip-path: polygon(
        0 58%, 18% 51%, 33% 67%, 54% 49%, 72% 66%,
        100% 55%, 100% 71%, 76% 84%, 58% 69%,
        37% 88%, 16% 73%, 0 81%
    );
    opacity: 0.85;
}

.seal {
    position: relative;
    z-index: 2;
    margin: 1rem 0 0;
    color: var(--ash);
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.verse {
    position: relative;
    z-index: 2;
    max-width: 34rem;
    margin: 0.85rem 0 0;
    color: rgba(158, 62, 58, 0.8);
    font-size: 0.74rem;
    line-height: 1.6;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.orbit {
    position: absolute;
    left: 51%;
    top: 49%;
    z-index: 1;
    width: min(88vmin, 860px);
    height: min(88vmin, 860px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: spin-orbit 42s linear infinite;
}

.orbit-text {
    fill: rgba(110, 22, 26, 0.72);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 3.15px;
    letter-spacing: 0.28px;
}

.note,
.hex-static {
    margin: 1.2rem 0 0;
    max-width: 38rem;
    color: rgba(194, 178, 154, 0.45);
    font-size: 0.82rem;
    line-height: 1.6;
    letter-spacing: 0.08em;
}

.hex-static {
    max-width: min(52rem, 90vw);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.14em;
}

.caret {
    display: inline-block;
    width: 0.62em;
    height: 1.05em;
    margin-left: 0.12em;
    background: currentColor;
    vertical-align: -0.12em;
    box-shadow: 0 0 8px currentColor;
    animation: blink 1.05s steps(1) infinite;
}

.cursor-row {
    height: 1.2em;
}

.stamp {
    position: absolute;
    z-index: 4;
    padding: 0.22rem 0.5rem;
    color: var(--blood);
    border: 2px solid var(--blood);
    background: rgba(7, 6, 10, 0.55);
    font-size: clamp(0.72rem, 1.5vw, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(var(--rot));
    pointer-events: none;
    box-shadow: 0 0 16px rgba(193, 18, 31, 0.25);
}

.gutter {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 7;
    overflow: hidden;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(193, 18, 31, 0.85);
    color: rgba(110, 28, 32, 0.8);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    white-space: nowrap;
    background: rgba(7, 6, 10, 0.72);
}

.gutter-track {
    display: inline-block;
    animation: crawl 22s linear infinite;
}

.gutter-track span {
    padding-right: 1.5rem;
}

.mute {
    position: fixed;
    right: 1.3rem;
    bottom: 2.35rem;
    z-index: 9;
    padding: 0.35rem 0.6rem;
    color: var(--ash);
    background: rgba(5, 3, 3, 0.8);
    border: 1px solid rgba(142, 28, 34, 0.7);
    font: 500 0.68rem/1 "IBM Plex Mono", ui-monospace, monospace;
    letter-spacing: 0.22em;
}

.mute:focus-visible {
    outline: 1px solid var(--blood);
    outline-offset: 3px;
}

.still {
    display: none;
}

.fallback {
    min-height: 100dvh;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 0.7rem 2.4rem 0.75rem 1rem;
    background: #1a0608;
    color: var(--bone);
    border-top: 1px solid var(--blood);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

#blazor-error-ui .reload {
    margin-left: 0.8rem;
    color: var(--blood);
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.8rem;
    top: 0.45rem;
    cursor: crosshair;
}

@keyframes grain {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 1%); }
    50% { transform: translate(1%, -2%); }
    75% { transform: translate(-1%, 2%); }
    100% { transform: translate(0, 0); }
}

@keyframes lamp {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.84; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes crawl {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes rift {
    0%, 100% { transform: translateX(0); }
    45% { transform: translateX(var(--slice)); }
    70% { transform: translateX(calc(var(--slice) * -0.65)); }
}

@keyframes rift-a {
    0%, 100% { transform: translate(0, 0); }
    35% { transform: translate(var(--slice), 0); }
    68% { transform: translate(calc(var(--slice) * -0.8), 0); }
}

@keyframes spin-orbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rift-b {
    0%, 100% { transform: translate(0, 0); }
    40% { transform: translate(calc(var(--slice) * -1), 0); }
    72% { transform: translate(calc(var(--slice) * 0.55), 0); }
}

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

    .stage,
    .noise,
    .slices,
    .gutter {
        display: none !important;
    }

    .still {
        display: flex;
    }

    .leave::before,
    .leave::after {
        content: none;
    }

    .curse {
        --split: 1px;
        --slice: 0px;
    }
}

@media (max-width: 640px) {
    .bezel {
        inset: 8px;
    }

    .bezel-id,
    .bezel-seal {
        letter-spacing: 0.12em;
        font-size: 0.58rem;
    }

    .sigil {
        width: 32px;
        height: 32px;
        top: 1rem;
        right: 1rem;
    }

    .stage,
    .still,
    .fallback {
        padding: 12vh 6vw 14vh;
    }
}
