:root {
    --tile-size: 32px;
}

/* ========================= */
/* RESET */
/* ========================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    position: relative;
    overflow-x: hidden;

    font-family: Arial, Helvetica, sans-serif;
    color: white;
    background: #170f0d;
}

img {
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================= */
/* WORLD BACKGROUND */
/* ========================= */

.world-bg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;

    width: 100%;
    min-height: 100vh;

    overflow: hidden;
    pointer-events: none;
}

.bg-base {
    position: absolute;
    inset: 0;
    z-index: 1;

    background-image: url("assets/blocks/netherrack.png");
    background-repeat: repeat;
    background-size: var(--tile-size) var(--tile-size);
    background-position: 0 var(--world-grid-y, 0px);

    image-rendering: pixelated;
}

.bg-vein-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.world-bg::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 5;

    pointer-events: none;

    background:
        radial-gradient(circle at 18% 18%, rgba(255, 85, 20, 0.06), transparent 24%),
        radial-gradient(circle at 82% 40%, rgba(120, 0, 0, 0.10), transparent 34%),
        linear-gradient(rgba(12, 2, 1, 0.28), rgba(8, 2, 1, 0.38));
}

.world-tile {
    position: absolute;

    width: var(--tile-size);
    height: var(--tile-size);

    background-repeat: no-repeat;
    background-size: var(--tile-size) var(--tile-size);

    image-rendering: pixelated;
}

.block-quartz {
    background-image: url("assets/blocks/nether_quartz_ore.png");
}

.block-gold {
    background-image: url("assets/blocks/nether_gold_ore.png");
}

.block-blackstone {
    background-image: url("assets/blocks/blackstone.png");
}

.block-debris {
    background-image: url("assets/blocks/ancient_debris_side.png");
}

/* ========================= */
/* TOP BAR */
/* ========================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: center;

    height: 108px;
    padding: 0 24px;

    overflow: hidden;

    background: rgba(217, 229, 245, 0.96);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

.topbar-logo {
    display: block;

    width: min(600px, 90vw);
    height: auto;
    max-height: none;

    object-fit: contain;
    image-rendering: pixelated;

    transform: scale(1.45);
    transform-origin: center;
}

/* ========================= */
/* HERO */
/* ========================= */

.hero {
    position: relative;
    z-index: auto;

    overflow: hidden;

    padding: 110px 20px 100px;

    color: #17213a;
    text-align: center;
    background: transparent;
}

.hero::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    background:
        radial-gradient(circle at 50% 18%, rgba(255, 155, 105, 0.14), transparent 34%),
        radial-gradient(circle at 15% 70%, rgba(255, 80, 55, 0.08), transparent 30%),
        linear-gradient(#9a2326, #7e161c 44%, #5c0f14 100%);
}


.hero-title,
.filters {
    position: relative;
    z-index: 6;
}

.hero-title {
    margin: 0 0 36px;
    line-height: 0;
}

.hero-title-img {
    display: block;

    width: min(512px, 90vw);
    height: auto;
    margin: 0 auto;

    image-rendering: pixelated;
}


.filters {
    display: flex;
    justify-content: center;
    gap: 12px;
}

select {
    padding: 14px 18px;

    border: 1px solid rgba(106, 58, 14, 0.32);
    color: #2b1a0d;
    background: #fff8e6;

    font-size: 18px;
    font-weight: 900;

    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

select:focus-visible {
    outline: 3px solid #f1c84b;
    outline-offset: 2px;
}

/* ========================= */
/* HERO FX - NETHER */
/* ========================= */

.hero-fx {
    position: absolute;
    inset: 0;
    z-index: 2;

    overflow: hidden;
    pointer-events: none;
}

.hero-lava,
.hero-spores {
    position: absolute;
    inset: 0;
}

.hero-lava {
    z-index: 1;
}

.hero-spores {
    z-index: 2;
}

/* The GIF was rebuilt from one 16x16 quarter of every 32x32 frame.
   It therefore renders as one true Minecraft block wide, not two. */
.hero-lava-stream {
    position: absolute;
    top: 0;
    bottom: 0;

    width: var(--tile-size);
    height: 100%;

    opacity: 0.34;

    background-image: url("assets/blocks/lava_flow_single.gif");
    background-repeat: repeat-y;
    background-size: var(--tile-size) var(--tile-size);
    background-position: 0 0;

    image-rendering: pixelated;

    filter: drop-shadow(0 0 6px rgba(255, 92, 0, 0.22));
}

.crimson-spore {
    position: absolute;
    bottom: -12px;
    left: 0;

    width: var(--spore-size, 2px);
    height: var(--spore-size, 2px);

    border-radius: 1px;
    background: var(--spore-color, #ff6b6b);
    opacity: 0;

    box-shadow:
        0 0 3px rgba(255, 110, 110, 0.22),
        0 0 7px rgba(255, 80, 80, 0.10);

    animation: crimsonSporeRise var(--spore-duration, 10s) linear infinite;
    will-change: transform, opacity;
}

@keyframes crimsonSporeRise {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0;
    }

    10% {
        opacity: var(--spore-opacity, 0.75);
    }

    25% {
        transform: translate3d(var(--drift-1, 6px), var(--rise-25, -80px), 0);
    }

    50% {
        transform: translate3d(var(--drift-2, -8px), var(--rise-50, -160px), 0);
    }

    75% {
        transform: translate3d(var(--drift-3, 10px), var(--rise-75, -240px), 0);
    }

    100% {
        transform: translate3d(var(--drift-4, -6px), var(--rise-100, -320px), 0);
        opacity: 0;
    }
}

/* ========================= */
/* CRIMSON SURFACE ROW */
/* ========================= */

.nether-surface {
    position: relative;
    z-index: 3;

    height: var(--tile-size);
    margin-top: 0;

    overflow: visible;
    background: transparent;
}
.nether-surface::before {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    z-index: 0;

    height: 8px;

    pointer-events: none;

    background: linear-gradient(
            to bottom,
            #ffe58a 0%,
            #d5a52a 40%,
            #8a5f10 100%
    );

    box-shadow:
            0 -1px 0 rgba(255, 241, 173, 0.55),
            0 2px 8px rgba(0, 0, 0, 0.32);
}
.nether-surface::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 2;

    pointer-events: none;

    background: linear-gradient(rgba(12, 2, 1, 0.28), rgba(8, 2, 1, 0.38));
}

.surface-tiles {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1;

    height: var(--tile-size);
}

.surface-tile {
    position: absolute;
    top: 0;

    width: var(--tile-size);
    height: var(--tile-size);

    background-image: url("assets/blocks/crimson_nylium_side.png");
    background-repeat: no-repeat;
    background-size: var(--tile-size) var(--tile-size);

    image-rendering: pixelated;
}

.surface-decor {
    position: absolute;
    inset: 0;
    z-index: 3;

    overflow: visible;
    pointer-events: none;
}

.surface-fungus,
.surface-roots,
.surface-stem,
.surface-leaf,
.surface-vine,
.surface-shroomlight {
    position: absolute;

    width: var(--tile-size);
    height: var(--tile-size);

    background-repeat: no-repeat;
    background-size: var(--tile-size) var(--tile-size);

    image-rendering: pixelated;
}

.surface-fungus {
    z-index: 3;
    background-image: url("assets/blocks/crimson_fungus.png");
}

.surface-roots {
    z-index: 3;
    background-image: url("assets/blocks/crimson_roots.png");
}

.surface-stem {
    z-index: 2;

    background-image: url("assets/blocks/crimson_stem.png");
    background-size: 32px 160px;
    background-position: 0 0;

    animation: crimsonStemAnim 0.8s steps(5) infinite;
}

.surface-leaf {
    z-index: 4;
    background-image: url("assets/blocks/nether_wart_block.png");
}

.surface-vine {
    z-index: 1;

    background-image: url("assets/blocks/weeping_vines_plant.png");
    background-repeat: repeat-y;
}

.surface-shroomlight {
    z-index: 4;
    background-image: url("assets/blocks/shroomlight.png");
}

@keyframes crimsonStemAnim {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 -160px;
    }
}

.surface-mobs {
    position: absolute;
    inset: 0;
    z-index: 6;

    overflow: visible;
    pointer-events: none;
}

.surface-mob-track {
    position: absolute;
    left: 0;
    bottom: var(--tile-size);

    height: 96px;

    animation-name: surfaceMobWalk;
    animation-duration: var(--walk-duration, 22s);
    animation-timing-function: linear;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;

    will-change: transform;
}

.surface-mob-img {
    display: block;

    width: auto;
    height: 96px;

    transform-origin: center bottom;
    image-rendering: pixelated;
}

.surface-mob-img.facing-right {
    transform: scaleX(-1);
}

@keyframes surfaceMobWalk {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(var(--walk-distance));
    }
}

/* ========================= */
/* PAGE */
/* ========================= */

.page {
    position: relative;
    z-index: 10;

    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 70px;
}

.patch-date {
    margin-bottom: 20px;

    color: #ffcfa8;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.patch-title {
    margin: 0 0 32px;

    font-size: 36px;
    text-shadow: 0 3px 7px rgba(0, 0, 0, 0.55);
}

.patch-summary {
    max-width: 760px;
    margin-bottom: 42px;

    font-size: 19px;
    line-height: 1.5;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

.group-title {
    margin: 48px 0 18px;

    font-size: 26px;
    text-shadow: 0 3px 7px rgba(0, 0, 0, 0.55);
}

/* ========================= */
/* PATCH CARDS */
/* ========================= */

.entity-card {
    margin-bottom: 28px;

    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 76, 167, 0.95);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.entity-header {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 14px 20px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(7, 63, 141, 0.97);
}

.entity-header img {
    width: 76px;
    height: 76px;

    border: 3px solid #adc8ff;
    object-fit: cover;
    background: #082c66;
}

.entity-header h3 {
    margin: 0;

    font-size: 26px;
    text-transform: uppercase;
}

.entity-body {
    padding: 24px 30px 30px;
}

.dev-note {
    margin-bottom: 24px;
    padding-left: 18px;

    border-left: 5px solid #ffb000;

    font-weight: 700;
    line-height: 1.5;
}

.ability {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;

    margin-top: 22px;
}

.ability img {
    width: 64px;
    height: 64px;
    padding: 8px;

    border: 2px solid rgba(255, 255, 255, 0.35);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.15);
}

.ability h4 {
    margin: 0 0 8px;
}

.ability ul {
    margin: 0;
    padding-left: 22px;
}

.ability li {
    margin-bottom: 8px;

    font-size: 18px;
    line-height: 1.35;
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 700px) {
    .topbar {
        height: 88px;
        padding: 0 12px;
    }

    .topbar-logo {
        width: min(420px, 92vw);
        max-height: none;
        transform: scale(1.3);
    }

    .hero {
        padding: 80px 16px 82px;
    }

    .hero-title-img {
        width: min(360px, 90vw);
    }

    .filters {
        flex-wrap: wrap;
    }

    .patch-title {
        font-size: 28px;
    }

    .ability {
        grid-template-columns: 1fr;
    }

    .nether-surface {
        height: var(--tile-size);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .surface-stem,
    .surface-mob-track,
    .crimson-spore {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
    }

    .hero-lava-stream {
        background-image: url("assets/blocks/lava_flow_single.png");
    }
}
