:root.bestiarium-rr-open,
body.bestiarium-rr-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.bestiarium-ruin-repair-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483550;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: #fff4d1;
    background: #160f0b;
    font-family: "EB Garamond", Georgia, serif;
    letter-spacing: 0;
    isolation: isolate;
    touch-action: none;
}

.bestiarium-rr-shell {
    display: grid;
    grid-template-rows: minmax(66px, auto) minmax(0, 1fr);
    width: 100%;
    height: 100%;
}

.bestiarium-rr-topbar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 30px);
    min-width: 0;
    padding: max(9px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
    border-bottom: 2px solid #b9892c;
    background:
        linear-gradient(90deg, rgba(31, 20, 13, .98), rgba(62, 38, 22, .96) 55%, rgba(31, 20, 13, .98)),
        repeating-linear-gradient(90deg, transparent 0 36px, rgba(255, 218, 139, .04) 37px 38px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .46);
}

.bestiarium-rr-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-right: auto;
}

.bestiarium-rr-brand > span {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid #d7ae55;
    border-radius: 50%;
    color: #f4d479;
    background: radial-gradient(circle at 35% 30%, #7b3f23, #2b180f 72%);
    box-shadow: inset 0 0 0 4px rgba(20, 10, 6, .5), 0 2px 9px #000;
    font-size: 24px;
}

.bestiarium-rr-brand strong,
.bestiarium-rr-brand small {
    display: block;
    max-width: min(42vw, 620px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bestiarium-rr-brand strong {
    color: #f4d479;
    font-family: Cinzel, Georgia, serif;
    font-size: clamp(17px, 1.55vw, 25px);
    font-weight: 700;
    line-height: 1.1;
}

.bestiarium-rr-brand small {
    margin-top: 2px;
    color: #d8c59c;
    font-size: clamp(12px, .9vw, 15px);
}

.bestiarium-rr-hud {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.bestiarium-rr-hud > span {
    display: grid;
    min-width: 92px;
    min-height: 40px;
    padding: 5px 10px;
    place-items: center;
    border: 1px solid rgba(223, 181, 83, .58);
    border-radius: 4px;
    color: #f8e6b0;
    background: rgba(8, 7, 6, .48);
    font-family: Cinzel, Georgia, serif;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

.bestiarium-ruin-repair-overlay.is-time-low .bestiarium-rr-hud [data-rr-timer] {
    border-color: #f0644d;
    color: #fff0d2;
    background: rgba(117, 24, 16, .72);
    animation: bestiarium-rr-time-pulse .65s ease-in-out infinite alternate;
}

.bestiarium-rr-close {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #f7e4b3;
    background: transparent;
    box-shadow: none;
    font: 34px/1 Arial, sans-serif;
    cursor: pointer;
}

.bestiarium-rr-close:hover,
.bestiarium-rr-close:focus-visible {
    border-color: #d3a744;
    color: #fff;
    background: rgba(122, 31, 21, .76);
    outline: none;
}

.bestiarium-rr-scene {
    --rr-background: none;
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: #4b4032;
    background-image: var(--rr-background);
    background-position: center center;
    background-size: cover;
    box-shadow: inset 0 0 90px rgba(0, 0, 0, .56);
    transition: filter 1.2s ease;
}

.bestiarium-rr-scene::before,
.bestiarium-rr-scene::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    transition: opacity 1.1s ease, background 1.1s ease;
}

.bestiarium-rr-scene::before {
    background:
        radial-gradient(circle at 50% 34%, transparent 0 20%, rgba(10, 7, 5, .18) 72%),
        linear-gradient(180deg, rgba(8, 7, 7, .1), transparent 44%, rgba(14, 8, 4, .45));
}

.bestiarium-rr-scene::after {
    z-index: 2;
    background: rgba(17, 13, 10, .36);
}

.bestiarium-rr-scene.is-cleared::after { background: rgba(17, 13, 10, .27); }
.bestiarium-rr-scene.is-masonry::after { background: rgba(17, 13, 10, .18); }

.bestiarium-rr-light {
    position: absolute;
    top: -12%;
    left: 35%;
    z-index: 3;
    width: 30%;
    height: 95%;
    opacity: 0;
    background: linear-gradient(105deg, transparent 15%, rgba(255, 238, 170, .23) 48%, transparent 78%);
    filter: blur(9px);
    transform: skewX(-8deg);
    transition: opacity 1.25s ease;
    pointer-events: none;
}

.bestiarium-rr-stage {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
}

.bestiarium-rr-live {
    position: absolute;
    z-index: 18;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(9px, env(safe-area-inset-bottom));
    max-width: min(68vw, 620px);
    min-height: 22px;
    padding: 5px 10px;
    border-left: 2px solid rgba(223, 178, 72, .75);
    color: #f7e5b2;
    background: rgba(24, 15, 9, .72);
    font-size: 14px;
    font-style: italic;
    text-align: right;
    pointer-events: none;
}

.bestiarium-rr-intro,
.bestiarium-rr-ending,
.bestiarium-rr-chapter {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(92vw, 660px);
    max-height: calc(100% - 28px);
    overflow: auto;
    padding: clamp(22px, 4vh, 42px) clamp(20px, 4vw, 48px);
    border: 2px solid #c99a3d;
    border-radius: 6px;
    color: #3d2616;
    background:
        linear-gradient(rgba(255, 247, 216, .96), rgba(236, 211, 153, .97)),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(99, 63, 29, .035) 6px);
    box-shadow: inset 0 0 0 5px rgba(116, 65, 21, .12), 0 22px 70px rgba(0, 0, 0, .68);
    text-align: center;
    transform: translate(-50%, -50%);
}

.bestiarium-rr-intro::before,
.bestiarium-rr-ending::before,
.bestiarium-rr-chapter::before {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(143, 87, 28, .42);
    content: "";
    pointer-events: none;
}

.bestiarium-rr-intro__crest,
.bestiarium-rr-ending__seal {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    place-items: center;
    border: 2px solid #9c6724;
    border-radius: 50%;
    color: #fcdda1;
    background: radial-gradient(circle at 35% 30%, #b54e2e, #4b2117 70%);
    box-shadow: inset 0 0 0 5px #dfb968, 0 4px 12px rgba(48, 24, 9, .38);
    font-family: Cinzel, serif;
    font-size: 28px;
}

.bestiarium-rr-intro__crest span {
    width: 22px;
    height: 30px;
    border: 4px solid #f0ce81;
    border-top-width: 8px;
    clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}

.bestiarium-rr-kicker {
    margin: 0 0 5px;
    color: #8d2c21;
    font-family: Cinzel, Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.bestiarium-rr-intro h2,
.bestiarium-rr-ending h2,
.bestiarium-rr-chapter h3 {
    margin: 0;
    color: #74241e;
    font-family: Cinzel, Georgia, serif;
    font-size: clamp(25px, 3vw, 42px);
    line-height: 1.14;
}

.bestiarium-rr-intro__lead,
.bestiarium-rr-ending > p,
.bestiarium-rr-chapter p {
    position: relative;
    margin: 14px auto 0;
    max-width: 520px;
    font-size: clamp(16px, 1.35vw, 20px);
    line-height: 1.45;
}

.bestiarium-rr-trials {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: clamp(18px, 3vh, 30px) 0;
}

.bestiarium-rr-trials > div {
    display: grid;
    min-width: 0;
    padding: 12px 7px;
    justify-items: center;
    border-top: 1px solid #bb8735;
    border-bottom: 1px solid #bb8735;
    color: #50311c;
}

.bestiarium-rr-trials b {
    display: grid;
    width: 28px;
    height: 28px;
    margin-bottom: 5px;
    place-items: center;
    border-radius: 50%;
    color: #fff0c5;
    background: #7a281f;
    font-family: Cinzel, serif;
}

.bestiarium-rr-trials span {
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 600;
}

.bestiarium-rr-primary,
.bestiarium-rr-secondary,
.bestiarium-rr-strike {
    position: relative;
    min-height: 48px;
    padding: 11px 23px;
    border: 2px solid #522014;
    border-radius: 4px;
    font-family: Cinzel, Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
}

.bestiarium-rr-primary,
.bestiarium-rr-strike {
    color: #fff0c0;
    background: linear-gradient(#a43a2d, #651e19);
    box-shadow: inset 0 0 0 2px rgba(246, 202, 105, .35), 0 4px 10px rgba(43, 20, 9, .36);
}

.bestiarium-rr-primary:hover,
.bestiarium-rr-primary:focus-visible,
.bestiarium-rr-strike:hover,
.bestiarium-rr-strike:focus-visible {
    border-color: #e2b955;
    color: #fff;
    background: linear-gradient(#bd4937, #79241c);
    outline: none;
    transform: translateY(-1px);
}

.bestiarium-rr-secondary {
    color: #4b2c17;
    background: #f1dca7;
}

.bestiarium-rr-chapter {
    width: min(84vw, 520px);
    padding-top: 28px;
    padding-bottom: 28px;
    animation: bestiarium-rr-chapter-in .36s ease both;
}

.bestiarium-rr-chapter__number {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 auto 9px;
    place-items: center;
    border: 1px solid #9e6a25;
    border-radius: 50%;
    color: #fff0c7;
    background: #6c291e;
    font: 700 19px Cinzel, serif;
}

.bestiarium-rr-phase {
    position: absolute;
    inset: 0;
}

.bestiarium-rr-phase__copy {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 14;
    width: min(92vw, 650px);
    padding: 10px 18px;
    border: 1px solid rgba(223, 181, 84, .62);
    border-radius: 4px;
    color: #f7e8bd;
    background: rgba(27, 18, 12, .82);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.bestiarium-rr-phase__copy h3 {
    margin: 0;
    color: #f3d375;
    font-family: Cinzel, Georgia, serif;
    font-size: clamp(18px, 1.65vw, 26px);
    line-height: 1.15;
}

.bestiarium-rr-phase__copy p {
    margin: 3px 0 0;
    font-size: clamp(13px, 1vw, 16px);
    line-height: 1.25;
}

.bestiarium-rr-progress {
    --rr-progress: 0;
    position: absolute;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 14;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 14px;
    width: min(54vw, 470px);
    min-width: 260px;
    padding: 7px 12px 9px;
    border: 1px solid rgba(223, 181, 84, .62);
    border-radius: 4px;
    color: #f8e7ba;
    background: rgba(27, 18, 12, .88);
    font-size: 14px;
    transform: translateX(-50%);
}

.bestiarium-rr-progress > i {
    position: relative;
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border: 1px solid rgba(232, 192, 96, .42);
    background: rgba(0, 0, 0, .42);
}

.bestiarium-rr-progress > i::after {
    display: block;
    width: calc(var(--rr-progress) * 100%);
    height: 100%;
    background: linear-gradient(90deg, #8e3326, #e3b950);
    box-shadow: 0 0 12px rgba(241, 199, 95, .65);
    content: "";
    transition: width .35s ease;
}

.bestiarium-rr-cart {
    position: absolute;
    right: 4.5%;
    bottom: 10%;
    z-index: 8;
    width: clamp(96px, 11vw, 155px);
    height: clamp(84px, 9vw, 125px);
    border: 2px dashed rgba(250, 213, 123, .72);
    border-radius: 50% 50% 8px 8px;
    background: rgba(236, 194, 103, .09);
    filter: drop-shadow(0 9px 8px rgba(0, 0, 0, .45));
}

.bestiarium-rr-cart::before {
    position: absolute;
    top: -25px;
    left: 50%;
    width: 130%;
    color: #ffe08c;
    content: "\2193";
    font: 700 26px Arial, sans-serif;
    text-align: center;
    transform: translateX(-50%);
    animation: bestiarium-rr-cart-arrow .8s ease-in-out infinite alternate;
}

.bestiarium-rr-cart__box {
    position: absolute;
    right: 8%;
    bottom: 24%;
    left: 8%;
    height: 47%;
    border: 3px solid #392416;
    clip-path: polygon(4% 0, 96% 0, 84% 100%, 16% 100%);
    background: repeating-linear-gradient(90deg, #704625 0 12px, #5a351d 13px 16px);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, .48);
}

.bestiarium-rr-cart > i {
    position: absolute;
    bottom: 6%;
    width: 23%;
    aspect-ratio: 1;
    border: 4px solid #2c1a10;
    border-radius: 50%;
    background: #6e4928;
}

.bestiarium-rr-cart > i:nth-of-type(1) { left: 17%; }
.bestiarium-rr-cart > i:nth-of-type(2) { right: 17%; }

.bestiarium-rr-debris {
    --rr-drag-x: 0px;
    --rr-drag-y: 0px;
    --rr-clear-x: 0px;
    --rr-clear-y: 0px;
    --rr-rotate: 0deg;
    --rr-size: 1;
    position: absolute;
    z-index: 9;
    width: calc(clamp(48px, 5vw, 76px) * var(--rr-size));
    aspect-ratio: 1.18;
    padding: 0;
    border: 2px solid #4b3521;
    border-radius: 7px 5px 8px 4px;
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .18), transparent 20%),
        linear-gradient(145deg, #b3a17c, #6b5b3f 70%);
    box-shadow: inset -7px -8px 13px rgba(35, 25, 14, .34), 0 7px 10px rgba(0, 0, 0, .42);
    cursor: grab;
    transform: translate3d(var(--rr-drag-x), var(--rr-drag-y), 0) rotate(var(--rr-rotate));
    transition: filter .18s ease, box-shadow .18s ease;
    touch-action: none;
    user-select: none;
}

.bestiarium-rr-debris span {
    position: absolute;
    inset: 22%;
    border: 2px solid rgba(70, 48, 27, .55);
    transform: rotate(45deg);
}

.bestiarium-rr-debris.is-variant-2 { border-radius: 50% 8px 12px 9px; background-color: #958462; }
.bestiarium-rr-debris.is-variant-3 { clip-path: polygon(8% 14%, 80% 0, 100% 72%, 70% 100%, 0 82%); }
.bestiarium-rr-debris.is-variant-4 { clip-path: polygon(0 22%, 34% 0, 100% 14%, 88% 100%, 18% 86%); }

.bestiarium-rr-debris:hover,
.bestiarium-rr-debris:focus-visible,
.bestiarium-rr-debris.is-dragging {
    z-index: 13;
    border-color: #f2cc70;
    outline: none;
    box-shadow: inset -7px -8px 13px rgba(35, 25, 14, .28), 0 0 0 4px rgba(242, 204, 112, .22), 0 11px 18px rgba(0, 0, 0, .5);
    filter: brightness(1.18);
}

.bestiarium-rr-debris.is-dragging { cursor: grabbing; transition: none; }
.bestiarium-rr-debris.is-error { animation: bestiarium-rr-shake .34s ease; }

.bestiarium-rr-debris.is-cleared {
    pointer-events: none;
    animation: bestiarium-rr-stone-clear .5s cubic-bezier(.3, .7, .3, 1) forwards;
}

.bestiarium-rr-sockets {
    position: absolute;
    inset: 0;
}

.bestiarium-rr-socket,
.bestiarium-rr-stone {
    display: grid;
    width: clamp(48px, 5.1vw, 76px);
    aspect-ratio: 1;
    padding: 0;
    place-items: center;
    border-radius: 5px;
    font: 700 clamp(19px, 2vw, 30px) Cinzel, serif;
    touch-action: none;
    user-select: none;
}

.bestiarium-rr-socket {
    position: absolute;
    z-index: 7;
    border: 2px dashed rgba(255, 219, 129, .86);
    color: rgba(255, 225, 151, .84);
    background: rgba(41, 30, 20, .56);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, .52), 0 0 18px rgba(237, 191, 78, .2);
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.bestiarium-rr-socket::after {
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(239, 198, 99, .3);
    border-radius: inherit;
    content: "";
    animation: bestiarium-rr-socket 1.6s ease-in-out infinite alternate;
}

.bestiarium-rr-socket.is-filled {
    border-style: solid;
    border-color: #4a3420;
    color: #4d321b;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .19), transparent 25%),
        linear-gradient(145deg, #c1ad81, #796745);
    box-shadow: inset -5px -6px 10px rgba(43, 30, 16, .36), 0 3px 9px rgba(0, 0, 0, .38);
    animation: bestiarium-rr-fit-in .35s ease both;
}

.bestiarium-rr-socket.is-filled::after { display: none; }
.bestiarium-rr-socket.is-error { border-color: #e65a43; color: #ffc2a9; animation: bestiarium-rr-shake .34s ease; }

.bestiarium-rr-stone-tray {
    position: absolute;
    right: 50%;
    bottom: 9%;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(6, minmax(48px, 76px));
    gap: clamp(5px, .75vw, 12px);
    padding: 10px 13px;
    border: 2px solid rgba(198, 147, 57, .72);
    border-radius: 6px;
    background: rgba(31, 20, 13, .9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .48), inset 0 0 0 3px rgba(255, 221, 139, .08);
    transform: translateX(50%);
}

.bestiarium-rr-stone {
    --rr-drag-x: 0px;
    --rr-drag-y: 0px;
    position: relative;
    z-index: 12;
    border: 2px solid #50361e;
    color: #52331a;
    background:
        radial-gradient(circle at 29% 24%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(145deg, #d1bd8f, #83704d 76%);
    box-shadow: inset -6px -7px 12px rgba(38, 25, 13, .35), 0 5px 9px rgba(0, 0, 0, .45);
    cursor: grab;
    transform: translate3d(var(--rr-drag-x), var(--rr-drag-y), 0);
}

.bestiarium-rr-stone:hover,
.bestiarium-rr-stone:focus-visible,
.bestiarium-rr-stone.is-selected,
.bestiarium-rr-stone.is-dragging {
    border-color: #ffdc82;
    outline: none;
    box-shadow: inset -6px -7px 12px rgba(38, 25, 13, .28), 0 0 0 4px rgba(240, 192, 75, .28), 0 9px 14px rgba(0, 0, 0, .5);
    filter: brightness(1.12);
}

.bestiarium-rr-stone.is-dragging {
    z-index: 17;
    cursor: grabbing;
    transition: none;
}

.bestiarium-rr-stone.is-error { animation: bestiarium-rr-shake .34s ease; }
.bestiarium-rr-stone.is-placed { pointer-events: none; opacity: 0; transform: scale(.7); transition: opacity .3s ease, transform .3s ease; }

.bestiarium-rr-socket.is-round,
.bestiarium-rr-stone.is-round { border-radius: 50%; }

.bestiarium-rr-socket.is-diamond,
.bestiarium-rr-stone.is-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }

.bestiarium-rr-socket.is-wedge-left,
.bestiarium-rr-stone.is-wedge-left { clip-path: polygon(8% 0, 100% 18%, 83% 100%, 0 78%); }

.bestiarium-rr-socket.is-wedge-right,
.bestiarium-rr-stone.is-wedge-right { clip-path: polygon(0 18%, 92% 0, 100% 78%, 17% 100%); }

.bestiarium-rr-socket.is-keystone,
.bestiarium-rr-stone.is-keystone { clip-path: polygon(17% 0, 83% 0, 100% 100%, 0 100%); }

.bestiarium-rr-hoist {
    position: absolute;
    top: 18%;
    left: 50%;
    z-index: 8;
    width: min(46vw, 520px);
    height: min(39vh, 340px);
    transform: translateX(-50%);
    pointer-events: none;
}

.bestiarium-rr-hoist > i {
    position: absolute;
    top: 0;
    bottom: 24%;
    left: 50%;
    width: 4px;
    background: repeating-linear-gradient(0deg, #b08a4c 0 6px, #5b4127 7px 10px);
    box-shadow: 2px 0 2px rgba(0, 0, 0, .45);
    transform: translateX(-50%);
}

.bestiarium-rr-hoist::before {
    position: absolute;
    top: 0;
    right: 7%;
    left: 7%;
    height: 16px;
    border: 3px solid #301e12;
    background: linear-gradient(#805331, #4e301d);
    box-shadow: 0 5px 9px rgba(0, 0, 0, .45);
    content: "";
}

.bestiarium-rr-keystone {
    --rr-lift: 0;
    position: absolute;
    bottom: calc(2% + var(--rr-lift) * 5%);
    left: 50%;
    display: grid;
    width: clamp(66px, 7.5vw, 112px);
    aspect-ratio: 1.2;
    place-items: center;
    border: 3px solid #4d351e;
    color: #6a431f;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .22), transparent 26%),
        linear-gradient(145deg, #cfb77d, #7d6840);
    box-shadow: inset -8px -8px 13px rgba(37, 24, 12, .32), 0 9px 16px rgba(0, 0, 0, .5);
    clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
    font-size: clamp(24px, 3vw, 42px);
    transform: translateX(-50%);
    transition: bottom .4s cubic-bezier(.2, .8, .25, 1);
}

.bestiarium-rr-timing {
    position: absolute;
    right: 50%;
    bottom: 28%;
    z-index: 12;
    width: min(76vw, 720px);
    height: 32px;
    border: 2px solid #d4a54b;
    border-radius: 4px;
    background: rgba(20, 14, 10, .88);
    box-shadow: inset 0 0 12px #000, 0 7px 20px rgba(0, 0, 0, .45);
    transform: translateX(50%);
}

.bestiarium-rr-timing::before {
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    height: 2px;
    background: rgba(246, 220, 149, .38);
    content: "";
    transform: translateY(-50%);
}

.bestiarium-rr-timing__target {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border: 1px solid #ffe396;
    background: linear-gradient(90deg, rgba(196, 128, 28, .25), rgba(255, 218, 104, .85), rgba(196, 128, 28, .25));
    box-shadow: 0 0 18px rgba(255, 210, 86, .68);
    transition: left .35s ease, width .35s ease;
}

.bestiarium-rr-timing__marker {
    position: absolute;
    top: -8px;
    left: 0;
    width: 10px;
    height: 44px;
    border: 2px solid #fff3bd;
    border-radius: 4px;
    background: #a53328;
    box-shadow: 0 0 10px rgba(255, 245, 197, .76);
    transform: translateX(-50%);
}

.bestiarium-rr-timing.is-hit { animation: bestiarium-rr-hit .45s ease; }
.bestiarium-rr-timing.is-miss { animation: bestiarium-rr-shake .34s ease; }

.bestiarium-rr-seals {
    position: absolute;
    bottom: 21.5%;
    left: 50%;
    z-index: 12;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.bestiarium-rr-seals i {
    width: 15px;
    height: 15px;
    border: 1px solid #d6ae55;
    border-radius: 50%;
    background: rgba(21, 13, 8, .75);
    box-shadow: inset 0 0 5px #000;
}

.bestiarium-rr-seals i.is-set {
    background: #f2c65e;
    box-shadow: 0 0 11px #f7d982;
    animation: bestiarium-rr-seal-set .42s ease;
}

.bestiarium-rr-strike {
    position: absolute;
    bottom: 10.5%;
    left: 50%;
    z-index: 13;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 210px;
    justify-content: center;
    transform: translateX(-50%);
}

.bestiarium-rr-strike:hover,
.bestiarium-rr-strike:focus-visible { transform: translate(-50%, -1px); }
.bestiarium-rr-strike > span { font-size: 21px; }
.bestiarium-rr-progress.is-seal { width: min(36vw, 300px); min-width: 220px; }

.bestiarium-rr-dust {
    position: absolute;
    z-index: 30;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.bestiarium-rr-dust i {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5c57c;
    box-shadow: 0 0 6px currentColor;
    animation: bestiarium-rr-dust .78s ease-out forwards;
}

.bestiarium-rr-dust.is-red i { color: #df5c47; background: #b53a2c; }
.bestiarium-rr-dust i:nth-child(1) { --rr-dx: 34px; --rr-dy: 0px; }
.bestiarium-rr-dust i:nth-child(2) { --rr-dx: 23px; --rr-dy: 27px; }
.bestiarium-rr-dust i:nth-child(3) { --rr-dx: -9px; --rr-dy: 32px; }
.bestiarium-rr-dust i:nth-child(4) { --rr-dx: -31px; --rr-dy: 12px; }
.bestiarium-rr-dust i:nth-child(5) { --rr-dx: -27px; --rr-dy: -22px; }
.bestiarium-rr-dust i:nth-child(6) { --rr-dx: 4px; --rr-dy: -34px; }
.bestiarium-rr-dust i:nth-child(7) { --rr-dx: 28px; --rr-dy: -18px; }

.bestiarium-rr-ending {
    width: min(92vw, 610px);
}

.bestiarium-rr-result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin: 17px 0 10px;
    color: #74241e;
}

.bestiarium-rr-result-score strong {
    font: 700 clamp(46px, 6vw, 78px)/1 Cinzel, serif;
}

.bestiarium-rr-result-score span { margin-left: 6px; font-size: 18px; }

.bestiarium-rr-result-stages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 13px 0;
    border: 1px solid #b98231;
    background: #b98231;
}

.bestiarium-rr-result-stages > div {
    display: grid;
    gap: 3px;
    padding: 9px 5px;
    color: #51321b;
    background: #f1dda9;
}

.bestiarium-rr-result-stages span { font-size: 13px; }
.bestiarium-rr-result-stages b { font: 700 17px Cinzel, serif; }

.bestiarium-rr-reward {
    margin: 14px 0 18px !important;
    color: #543116;
}

.bestiarium-rr-reward span { margin-right: 8px; }
.bestiarium-rr-reward strong { color: #9a2e22; font: 700 25px Cinzel, serif; }
.bestiarium-rr-ending__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.bestiarium-rr-ending.is-error .bestiarium-rr-ending__seal { background: #7c251e; }

.bestiarium-rr-loader {
    display: block;
    width: 42px;
    height: 42px;
    margin: 20px auto 0;
    border: 4px solid rgba(119, 68, 25, .23);
    border-top-color: #9b3124;
    border-radius: 50%;
    animation: bestiarium-rr-spin .8s linear infinite;
}

/* v4.121.0: the worksite now reveals a genuinely rebuilt scene as earned score rises. */
.bestiarium-rr-restored-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-position: center center;
    background-size: cover;
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    filter: saturate(.9) contrast(1.03);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity .35s ease, clip-path .85s cubic-bezier(.22, .72, .24, 1), filter 1s ease;
    pointer-events: none;
}

.bestiarium-rr-scene::before { z-index: 2; }
.bestiarium-rr-scene::after { z-index: 3; }
.bestiarium-rr-scene.is-stabilized::after { background: rgba(17, 13, 10, .27); }
.bestiarium-rr-scene.is-rebuilt::after { background: rgba(17, 13, 10, .16); }
.bestiarium-rr-scene.is-consecrated::after { background: rgba(17, 13, 10, .06); }

.bestiarium-rr-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    opacity: calc(1 - var(--rr-restoration));
    transition: opacity .8s ease;
    pointer-events: none;
}

.bestiarium-rr-atmosphere i {
    position: absolute;
    width: 36vw;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224, 193, 139, .35), transparent);
    filter: blur(.4px);
    animation: bestiarium-rr-wind 8s linear infinite;
}

.bestiarium-rr-atmosphere i:nth-child(1) { top: 31%; left: -35%; animation-delay: -2s; }
.bestiarium-rr-atmosphere i:nth-child(2) { top: 52%; left: -45%; width: 24vw; animation-duration: 11s; }
.bestiarium-rr-atmosphere i:nth-child(3) { top: 74%; left: -30%; width: 42vw; animation-delay: -6s; animation-duration: 13s; }

.bestiarium-rr-light { z-index: 4; }
.bestiarium-rr-scene.is-consecrated .bestiarium-rr-light {
    opacity: 1;
    animation: bestiarium-rr-light 3.2s ease-in-out infinite alternate;
}

.bestiarium-rr-stage { z-index: 6; }
.bestiarium-rr-live { z-index: 22; }

.bestiarium-rr-intro,
.bestiarium-rr-ending,
.bestiarium-rr-chapter {
    border: 1px solid #aa7d31;
    border-radius: 2px;
    color: #eadbb9;
    background:
        linear-gradient(135deg, rgba(25, 20, 16, .97), rgba(50, 37, 27, .96)),
        repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 222, 151, .025) 29px 30px);
    box-shadow: inset 0 0 0 1px rgba(244, 213, 139, .12), 0 24px 80px rgba(0, 0, 0, .76);
}

.bestiarium-rr-intro::before,
.bestiarium-rr-ending::before,
.bestiarium-rr-chapter::before { border-color: rgba(204, 161, 75, .32); }

.bestiarium-rr-intro__crest,
.bestiarium-rr-ending__seal {
    border-radius: 3px;
    color: #d7b05d;
    background: linear-gradient(145deg, #3c2b20, #18110d);
    box-shadow: inset 0 0 0 2px rgba(213, 174, 91, .24), 0 5px 14px rgba(0, 0, 0, .48);
}

.bestiarium-rr-kicker { color: #c69a45; }
.bestiarium-rr-intro h2,
.bestiarium-rr-ending h2,
.bestiarium-rr-chapter h3 { color: #f0cf7a; }

.bestiarium-rr-trials { gap: 1px; border: 1px solid rgba(190, 143, 57, .55); background: rgba(190, 143, 57, .55); }
.bestiarium-rr-trials > div {
    padding: 13px 9px;
    border: 0;
    background: rgba(16, 12, 9, .72);
}
.bestiarium-rr-trials b {
    width: auto;
    height: auto;
    margin-bottom: 7px;
    border-radius: 0;
    color: #bd9142;
    background: none;
    font-size: 12px;
}
.bestiarium-rr-trials span { color: #ecddb8; }

.bestiarium-rr-result-score,
.bestiarium-rr-reward,
.bestiarium-rr-result-stages > div { color: #eadbb9; }
.bestiarium-rr-result-score strong,
.bestiarium-rr-reward strong { color: #e2b95e; }
.bestiarium-rr-result-stages { border-color: #8c6429; background: #8c6429; }
.bestiarium-rr-result-stages > div { background: rgba(20, 14, 10, .83); }

.bestiarium-rr-yard {
    position: absolute;
    bottom: 10%;
    z-index: 10;
    width: clamp(155px, 17vw, 235px);
    height: clamp(92px, 10vw, 132px);
    padding: 10px 12px;
    border: 1px solid rgba(212, 169, 83, .72);
    border-radius: 2px;
    color: #f0d999;
    background: rgba(25, 18, 12, .82);
    box-shadow: inset 0 0 0 2px rgba(224, 186, 104, .08), 0 12px 30px rgba(0, 0, 0, .46);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.bestiarium-rr-yard.is-salvage { left: 3.5%; }
.bestiarium-rr-yard.is-waste { right: 3.5%; }
.bestiarium-rr-yard > span {
    position: absolute;
    top: 8px;
    right: 8px;
    left: 8px;
    font-family: Cinzel, Georgia, serif;
    font-size: clamp(11px, .9vw, 14px);
    font-weight: 700;
    text-transform: uppercase;
}
.bestiarium-rr-yard > i {
    position: absolute;
    right: 13%;
    bottom: 12%;
    left: 13%;
    height: 46%;
    border: 2px solid #342316;
    background: repeating-linear-gradient(90deg, #755031 0 15px, #50331f 16px 20px);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, .5);
}
.bestiarium-rr-yard.is-salvage > i {
    border-top: 5px double #2f1d11;
    background:
        linear-gradient(180deg, transparent 0 45%, rgba(25, 16, 10, .55) 46% 52%, transparent 53%),
        repeating-linear-gradient(90deg, #9b875f 0 25%, #756342 26% 31%);
}
.bestiarium-rr-yard.is-waste > i { clip-path: polygon(4% 0, 96% 0, 84% 100%, 16% 100%); }
.bestiarium-rr-yard:hover,
.bestiarium-rr-yard:focus-visible,
.bestiarium-rr-yard.is-receiving {
    border-color: #f0cd78;
    background: rgba(55, 38, 22, .9);
    box-shadow: inset 0 0 0 2px rgba(240, 205, 120, .15), 0 0 0 4px rgba(218, 171, 75, .14), 0 14px 34px rgba(0, 0, 0, .5);
    outline: none;
}
.bestiarium-rr-yard.is-error { border-color: #d35242; animation: bestiarium-rr-shake .34s ease; }

.bestiarium-rr-debris {
    border-radius: 2px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .12), transparent 35%),
        linear-gradient(145deg, #a2906d, #66563c 72%);
}
.bestiarium-rr-debris span {
    inset: 18% 12%;
    border: 0;
    border-top: 1px solid rgba(60, 41, 23, .6);
    border-bottom: 1px solid rgba(214, 193, 149, .2);
    transform: rotate(-5deg);
}
.bestiarium-rr-debris > i {
    position: absolute;
    top: 20%;
    left: 18%;
    width: 14px;
    height: 10px;
    border-left: 2px solid rgba(67, 44, 24, .65);
    border-bottom: 2px solid rgba(67, 44, 24, .65);
}
.bestiarium-rr-debris.is-waste {
    border-color: #3d3022;
    background: linear-gradient(145deg, #81765f, #4d4538 72%);
    clip-path: polygon(5% 17%, 36% 0, 89% 9%, 100% 61%, 72% 100%, 12% 84%);
}
.bestiarium-rr-debris.is-waste > i { display: none; }
.bestiarium-rr-debris.is-selected {
    z-index: 13;
    border-color: #f2cc70;
    outline: none;
    box-shadow: inset -7px -8px 13px rgba(35, 25, 14, .28), 0 0 0 5px rgba(242, 204, 112, .25), 0 11px 18px rgba(0, 0, 0, .5);
    filter: brightness(1.16);
}

.bestiarium-rr-socket,
.bestiarium-rr-stone {
    width: clamp(50px, 4.8vw, 72px);
    border-radius: 2px;
    font-size: clamp(10px, 1vw, 14px);
}
.bestiarium-rr-socket {
    border: 1px dashed rgba(235, 201, 126, .72);
    color: rgba(239, 210, 144, .76);
    background: rgba(37, 29, 22, .47);
    transform: translate(-50%, -50%) rotate(var(--rr-target-angle));
}
.bestiarium-rr-socket > span,
.bestiarium-rr-stone > span {
    position: absolute;
    top: 8%;
    left: 10%;
    color: rgba(82, 53, 29, .82);
    font: 700 10px Cinzel, serif;
}
.bestiarium-rr-socket > span { color: rgba(250, 218, 145, .76); }
.bestiarium-rr-socket > i,
.bestiarium-rr-stone > i {
    position: absolute;
    right: 15%;
    bottom: 18%;
    left: 15%;
    height: 1px;
    background: rgba(77, 50, 28, .45);
    transform: rotate(-7deg);
}
.bestiarium-rr-socket > i { background: rgba(246, 216, 149, .42); }
.bestiarium-rr-socket.is-filled { transform: translate(-50%, -50%) rotate(var(--rr-target-angle)); }

.bestiarium-rr-stone-tray {
    bottom: 8%;
    grid-template-columns: repeat(8, minmax(50px, 72px));
    padding: 9px 12px;
    border-width: 1px;
    border-radius: 2px;
    background: rgba(24, 17, 12, .94);
}
.bestiarium-rr-stone {
    border-width: 1px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .18), transparent 34%),
        linear-gradient(145deg, #b8a47b, #726041 76%);
    transform: translate3d(var(--rr-drag-x), var(--rr-drag-y), 0) rotate(var(--rr-angle));
}
.bestiarium-rr-stone.is-placed { transform: rotate(var(--rr-angle)) scale(.7); }
.bestiarium-rr-socket.is-broad,
.bestiarium-rr-stone.is-broad { aspect-ratio: 1.35; }
.bestiarium-rr-socket.is-tall,
.bestiarium-rr-stone.is-tall { aspect-ratio: .78; }
.bestiarium-rr-socket.is-arch-left,
.bestiarium-rr-stone.is-arch-left { clip-path: polygon(5% 12%, 100% 0, 88% 100%, 0 82%); }
.bestiarium-rr-socket.is-arch-right,
.bestiarium-rr-stone.is-arch-right { clip-path: polygon(0 0, 95% 12%, 100% 82%, 12% 100%); }
.bestiarium-rr-socket.is-crown-left,
.bestiarium-rr-stone.is-crown-left { clip-path: polygon(12% 0, 100% 18%, 82% 100%, 0 86%); }
.bestiarium-rr-socket.is-crown-right,
.bestiarium-rr-stone.is-crown-right { clip-path: polygon(0 18%, 88% 0, 100% 86%, 18% 100%); }

.bestiarium-rr-stone-controls {
    position: absolute;
    right: 50%;
    bottom: calc(8% + clamp(76px, 7vw, 98px));
    z-index: 14;
    display: grid;
    grid-template-columns: 46px minmax(130px, auto) 46px;
    align-items: stretch;
    border: 1px solid rgba(202, 154, 65, .65);
    background: rgba(24, 17, 12, .94);
    box-shadow: 0 9px 24px rgba(0, 0, 0, .4);
    transform: translateX(50%);
}
.bestiarium-rr-stone-controls > button {
    min-width: 46px;
    min-height: 44px;
    padding: 0;
    border: 0;
    color: #f0d488;
    background: rgba(88, 55, 29, .72);
    font: 25px/1 Georgia, serif;
    cursor: pointer;
}
.bestiarium-rr-stone-controls > button:disabled { opacity: .34; cursor: not-allowed; }
.bestiarium-rr-stone-controls > button:not(:disabled):hover,
.bestiarium-rr-stone-controls > button:not(:disabled):focus-visible { background: #7c4b25; outline: 1px solid #e4ba60; }
.bestiarium-rr-stone-controls > span {
    display: grid;
    min-width: 0;
    padding: 4px 13px;
    place-content: center;
    color: #ead9ae;
    text-align: center;
}
.bestiarium-rr-stone-controls small { font-size: 10px; text-transform: uppercase; }
.bestiarium-rr-stone-controls b { color: #f2cc73; font: 700 16px Cinzel, serif; }

.bestiarium-rr-stress {
    --rr-stress: 0;
    position: absolute;
    bottom: max(13px, env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    z-index: 14;
    display: grid;
    grid-template-columns: auto auto;
    gap: 3px 12px;
    width: min(25vw, 250px);
    padding: 7px 10px 9px;
    border: 1px solid rgba(208, 160, 68, .62);
    color: #edddb5;
    background: rgba(25, 17, 12, .9);
    font-size: 12px;
}
.bestiarium-rr-stress > b { text-align: right; }
.bestiarium-rr-stress > i {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border: 1px solid rgba(213, 175, 92, .35);
    background: #120c08;
}
.bestiarium-rr-stress > i::after {
    display: block;
    width: calc(var(--rr-stress) * 100%);
    height: 100%;
    background: linear-gradient(90deg, #b88b36, #a12d25);
    content: "";
    transition: width .25s ease;
}
.bestiarium-rr-scene.is-stressed::before {
    background:
        linear-gradient(74deg, transparent 49.6%, rgba(74, 23, 18, .7) 50%, transparent 50.4%) 51% 14% / 90px 150px no-repeat,
        radial-gradient(circle at 50% 34%, transparent 0 20%, rgba(10, 7, 5, .2) 72%),
        linear-gradient(180deg, rgba(8, 7, 7, .1), transparent 44%, rgba(14, 8, 4, .45));
}

@keyframes bestiarium-rr-wind { to { transform: translateX(155vw); } }

@keyframes bestiarium-rr-spin { to { transform: rotate(360deg); } }
@keyframes bestiarium-rr-time-pulse { to { box-shadow: 0 0 13px rgba(244, 78, 55, .55); } }
@keyframes bestiarium-rr-light { to { opacity: .72; transform: translateX(3%) skewX(-8deg); } }
@keyframes bestiarium-rr-chapter-in { from { opacity: 0; transform: translate(-50%, -47%) scale(.96); } }
@keyframes bestiarium-rr-cart-arrow { to { transform: translate(-50%, 5px); } }
@keyframes bestiarium-rr-socket { to { opacity: .42; transform: scale(1.1); } }
@keyframes bestiarium-rr-fit-in { from { opacity: .3; filter: brightness(1.8); transform: translate(-50%, -50%) rotate(var(--rr-target-angle)) scale(1.22); } to { transform: translate(-50%, -50%) rotate(var(--rr-target-angle)) scale(1); } }
@keyframes bestiarium-rr-hit { 50% { box-shadow: 0 0 0 7px rgba(251, 211, 100, .28), inset 0 0 18px #f5c95d; } }
@keyframes bestiarium-rr-seal-set { 50% { transform: scale(1.6); } }
@keyframes bestiarium-rr-shake { 20% { translate: -7px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
@keyframes bestiarium-rr-stone-clear {
    to {
        opacity: 0;
        transform: translate3d(calc(var(--rr-drag-x) + var(--rr-clear-x)), calc(var(--rr-drag-y) + var(--rr-clear-y)), 0) rotate(22deg) scale(.15);
    }
}
@keyframes bestiarium-rr-dust {
    0% { opacity: 1; transform: translate(0, 0) scale(.55); }
    100% { opacity: 0; transform: translate(var(--rr-dx), var(--rr-dy)) scale(1.3); }
}

@media (max-width: 760px) {
    .bestiarium-rr-shell { grid-template-rows: auto minmax(0, 1fr); }
    .bestiarium-rr-topbar { flex-wrap: wrap; gap: 5px 9px; padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: 7px; }
    .bestiarium-rr-brand > span { width: 37px; height: 37px; flex-basis: 37px; font-size: 19px; }
    .bestiarium-rr-brand strong { max-width: 58vw; font-size: 16px; }
    .bestiarium-rr-brand small { display: none; }
    .bestiarium-rr-close { width: 39px; height: 39px; flex-basis: 39px; font-size: 30px; }
    .bestiarium-rr-hud { order: 3; width: 100%; gap: 5px; }
    .bestiarium-rr-hud > span { min-width: 0; min-height: 30px; flex: 1 1 0; padding: 3px 4px; font-size: 11px; }
    .bestiarium-rr-scene { background-position: center center; }
    .bestiarium-rr-phase__copy { top: 8px; width: calc(100% - 18px); padding: 7px 10px; }
    .bestiarium-rr-phase__copy h3 { font-size: 17px; }
    .bestiarium-rr-phase__copy p { font-size: 12px; }
    .bestiarium-rr-live { display: none; }
    .bestiarium-rr-progress { bottom: max(5px, env(safe-area-inset-bottom)); width: min(78vw, 390px); min-width: 0; padding: 5px 9px 7px; font-size: 12px; }
    .bestiarium-rr-cart { right: 2.5%; bottom: 11%; width: 88px; height: 75px; }
    .bestiarium-rr-cart::before { top: -20px; font-size: 21px; }
    .bestiarium-rr-debris { width: calc(clamp(45px, 13vw, 62px) * var(--rr-size)); }
    .bestiarium-rr-yard { bottom: 10%; width: 42vw; min-width: 0; height: 78px; padding: 6px; }
    .bestiarium-rr-yard.is-salvage { left: 2%; }
    .bestiarium-rr-yard.is-waste { right: 2%; }
    .bestiarium-rr-yard > span { top: 5px; font-size: 9px; }
    .bestiarium-rr-yard > i { bottom: 8%; height: 42%; }
    .bestiarium-rr-stone-tray { bottom: 5%; grid-template-columns: repeat(4, minmax(44px, 56px)); gap: 5px; padding: 6px 8px; }
    .bestiarium-rr-socket,
    .bestiarium-rr-stone { width: clamp(44px, 13vw, 56px); font-size: 12px; }
    .bestiarium-rr-stone-controls { bottom: calc(5% + 124px); grid-template-columns: 44px minmax(110px, auto) 44px; }
    .bestiarium-rr-fit .bestiarium-rr-progress { top: 78px; right: 7px; bottom: auto; left: auto; width: 150px; transform: none; }
    .bestiarium-rr-hoist { top: 17%; width: 72vw; height: 36vh; max-height: 290px; }
    .bestiarium-rr-timing { bottom: 30%; width: 88vw; }
    .bestiarium-rr-seals { bottom: 23.5%; }
    .bestiarium-rr-strike { bottom: 11%; min-width: 190px; min-height: 46px; }
    .bestiarium-rr-progress.is-seal { display: none; }
    .bestiarium-rr-stress { bottom: max(5px, env(safe-area-inset-bottom)); width: 145px; padding: 5px 7px; font-size: 10px; }
    .bestiarium-rr-intro,
    .bestiarium-rr-ending { width: calc(100% - 22px); padding: 20px 17px; }
    .bestiarium-rr-intro__crest,
    .bestiarium-rr-ending__seal { width: 50px; height: 50px; margin-bottom: 8px; }
    .bestiarium-rr-intro h2,
    .bestiarium-rr-ending h2 { font-size: 25px; }
    .bestiarium-rr-intro__lead,
    .bestiarium-rr-ending > p { margin-top: 9px; font-size: 15px; line-height: 1.3; }
    .bestiarium-rr-trials { margin: 13px 0; gap: 4px; }
    .bestiarium-rr-trials > div { padding: 8px 3px; }
    .bestiarium-rr-trials span { font-size: 12px; }
    .bestiarium-rr-primary,
    .bestiarium-rr-secondary { min-height: 46px; padding: 9px 15px; font-size: 13px; }
}

@media (max-height: 590px) and (orientation: landscape) {
    .bestiarium-rr-shell { grid-template-rows: 52px minmax(0, 1fr); }
    .bestiarium-rr-topbar { flex-wrap: nowrap; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
    .bestiarium-rr-brand > span { width: 34px; height: 34px; flex-basis: 34px; }
    .bestiarium-rr-brand small { display: none; }
    .bestiarium-rr-brand strong { font-size: 14px; }
    .bestiarium-rr-hud { order: initial; width: auto; }
    .bestiarium-rr-hud > span { min-width: 75px; min-height: 31px; font-size: 10px; }
    .bestiarium-rr-close { width: 34px; height: 34px; flex-basis: 34px; }
    .bestiarium-rr-phase__copy { top: 5px; width: min(70vw, 620px); padding: 4px 10px; }
    .bestiarium-rr-phase__copy h3 { font-size: 15px; }
    .bestiarium-rr-phase__copy p { font-size: 11px; }
    .bestiarium-rr-progress { bottom: 4px; padding-top: 3px; padding-bottom: 4px; }
    .bestiarium-rr-cart { bottom: 10%; width: 82px; height: 65px; }
    .bestiarium-rr-yard { bottom: 7%; width: 150px; height: 64px; }
    .bestiarium-rr-yard > span { font-size: 9px; }
    .bestiarium-rr-stone-tray { bottom: 4%; grid-template-columns: repeat(8, 42px); padding: 4px 7px; }
    .bestiarium-rr-socket,
    .bestiarium-rr-stone { width: 42px; font-size: 10px; }
    .bestiarium-rr-stone-controls { bottom: calc(4% + 51px); grid-template-columns: 38px minmax(100px, auto) 38px; }
    .bestiarium-rr-stone-controls > button { min-width: 38px; min-height: 36px; }
    .bestiarium-rr-fit .bestiarium-rr-progress { top: 52px; }
    .bestiarium-rr-hoist { top: 14%; height: 51vh; }
    .bestiarium-rr-timing { bottom: 28%; height: 26px; }
    .bestiarium-rr-timing__marker { height: 36px; }
    .bestiarium-rr-seals { bottom: 20%; }
    .bestiarium-rr-stress { bottom: 3px; width: 165px; }
    .bestiarium-rr-strike { bottom: 6.5%; min-height: 40px; padding: 7px 16px; }
    .bestiarium-rr-intro,
    .bestiarium-rr-ending { width: min(88vw, 720px); padding: 14px 24px; }
    .bestiarium-rr-intro__crest,
    .bestiarium-rr-ending__seal { width: 42px; height: 42px; margin-bottom: 4px; }
    .bestiarium-rr-intro h2,
    .bestiarium-rr-ending h2 { font-size: 22px; }
    .bestiarium-rr-intro__lead,
    .bestiarium-rr-ending > p { margin-top: 5px; font-size: 14px; }
    .bestiarium-rr-trials { margin: 8px 0; }
    .bestiarium-rr-trials > div { padding: 5px; }
    .bestiarium-rr-trials b { width: 22px; height: 22px; }
    .bestiarium-rr-primary { min-height: 39px; padding: 6px 17px; }
    .bestiarium-rr-result-score { margin: 6px 0; }
    .bestiarium-rr-result-score strong { font-size: 38px; }
    .bestiarium-rr-result-stages { margin: 6px 0; }
    .bestiarium-rr-reward { margin: 6px 0 8px !important; }
}

@media (pointer: coarse) {
    .bestiarium-rr-debris,
    .bestiarium-rr-socket,
    .bestiarium-rr-stone,
    .bestiarium-rr-close { min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .bestiarium-ruin-repair-overlay *,
    .bestiarium-ruin-repair-overlay *::before,
    .bestiarium-ruin-repair-overlay *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
