@font-face {
    font-family: "Voxel UI";
    src: url("../assets/fonts/minecraft-ui-regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Voxel UI";
    src: url("../assets/fonts/minecraft-ui-bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --voxel-black: #000;
    --voxel-white: #fff;
    --voxel-focus: #777;
    --voxel-shadow: rgba(0, 0, 0, 0.38);
    --voxel-font: "Voxel UI", monospace;
}

.pixel-panel {
    color: var(--voxel-black);
    background: var(--voxel-white);
    border: 4px solid var(--voxel-black);
    border-radius: 0;
    box-shadow:
        0 0 0 3px var(--voxel-white),
        10px 12px 0 var(--voxel-shadow);
    box-sizing: border-box;
    image-rendering: pixelated;
}

.voxel-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 14px;
    border: 3px solid var(--voxel-black);
    border-radius: 0;
    color: var(--voxel-black);
    background: var(--voxel-white);
    font: 500 18px/1 var(--voxel-font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
}

.voxel-menu-button--primary {
    color: var(--voxel-white);
    background: var(--voxel-black);
    font-weight: 700;
}

.voxel-menu-button:hover {
    color: var(--voxel-white);
    background: var(--voxel-black);
}

.voxel-menu-button--primary:hover {
    color: var(--voxel-black);
    background: var(--voxel-white);
}

.voxel-menu-button:active {
    transform: translate(2px, 2px);
}

.voxel-menu-button:focus-visible,
.voxel-menu-input:focus-visible,
.voxel-menu-crumb:focus-visible,
.world-card:focus-visible,
.footer-link:focus-visible,
.brand-link:focus-visible {
    outline: 3px solid var(--voxel-focus);
    outline-offset: 3px;
}

.voxel-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.voxel-menu-grid-span {
    grid-column: 1 / -1;
}

.voxel-menu-input {
    min-height: 46px;
    padding: 10px 12px;
    border: 3px dotted var(--voxel-black);
    border-radius: 0;
    color: var(--voxel-black);
    background: var(--voxel-white);
    font: 500 18px/1 var(--voxel-font);
    box-sizing: border-box;
}

.voxel-menu-range {
    width: 100%;
    height: 30px;
    margin: 4px 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.voxel-menu-range::-webkit-slider-runnable-track {
    height: 12px;
    border: 3px solid var(--voxel-black);
    background: var(--voxel-white);
    box-sizing: border-box;
}

.voxel-menu-range::-webkit-slider-thumb {
    width: 18px;
    height: 26px;
    margin-top: -10px;
    border: 3px solid var(--voxel-black);
    border-radius: 0;
    background: var(--voxel-white);
    appearance: none;
    -webkit-appearance: none;
}

.voxel-menu-range::-moz-range-track {
    height: 8px;
    border: 3px solid var(--voxel-black);
    background: var(--voxel-white);
}

.voxel-menu-range::-moz-range-thumb {
    width: 14px;
    height: 22px;
    border: 3px solid var(--voxel-black);
    border-radius: 0;
    background: var(--voxel-white);
}

.miniwelt-page {
    min-width: 280px;
    min-height: 100%;
    margin: 0;
    color: var(--voxel-black);
    background-color: #b8e2f5;
    background-image: url("../assets/screenshots/empty-blurred-background.png");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    font-family: var(--voxel-font);
    image-rendering: pixelated;
}

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

.miniwelt-page img {
    max-width: 100%;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 10px 12px;
    border: 3px solid var(--voxel-black);
    color: var(--voxel-white);
    background: var(--voxel-black);
    font: 700 16px/1 var(--voxel-font);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.homepage-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 18px 20px;
    margin-bottom: 30px;
}

.brand-link {
    display: block;
    flex: 0 1 340px;
    min-width: 180px;
}

.brand-logo {
    display: block;
    width: 325px;
    height: auto;
    image-rendering: pixelated;
}

.site-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.site-nav .voxel-menu-button {
    min-width: 158px;
}

.homepage-main {
    display: grid;
    gap: 30px;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 30px;
    padding: clamp(24px, 4vw, 48px);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-title {
    max-width: 900px;
    margin: 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 0.98;
    letter-spacing: 0.01em;
}

.hero-copy {
    max-width: 820px;
    margin: 18px 0 0;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.35;
}

.hero-actions {
    display: grid;
    gap: 8px;
    min-width: 230px;
}

.world-section {
    padding: clamp(20px, 3vw, 34px);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.section-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
}

.section-copy {
    max-width: 590px;
    margin: 8px 0 0;
    font-size: 17px;
    line-height: 1.35;
}

.section-count {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 2px solid var(--voxel-black);
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
}

.world-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.world-grid--public {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.world-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--voxel-black);
    color: var(--voxel-black);
    background: var(--voxel-white);
    box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.28);
    text-decoration: none;
    image-rendering: pixelated;
}

.world-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 9px 0 rgba(0, 0, 0, 0.15);
}

.world-card:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.35);
}

.world-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin: 0;
    border-bottom: 3px solid var(--voxel-black);
    background: #8ed169;
}

.world-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    filter: var(--thumbnail-filter, none);
    transform: scale(1.02);
}

.world-grid .world-card:nth-child(4n + 2) {
    --thumbnail-filter: hue-rotate(38deg) saturate(1.2);
}

.world-grid .world-card:nth-child(4n + 3) {
    --thumbnail-filter: hue-rotate(185deg) saturate(1.25) contrast(1.05);
}

.world-grid .world-card:nth-child(4n + 4) {
    --thumbnail-filter: sepia(0.38) saturate(1.45) contrast(1.08);
}

.world-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    padding: 6px 7px;
    border: 2px solid var(--voxel-black);
    color: var(--voxel-white);
    background: var(--voxel-black);
    font-size: 13px;
    line-height: 1;
}

.world-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.world-card-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.world-card-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.08;
}

.world-author {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1.2;
    opacity: 0.66;
}

.world-description {
    margin: 10px 0 16px;
    font-size: 15px;
    line-height: 1.35;
}

.world-open {
    margin-top: auto;
    padding-top: 11px;
    border-top: 2px dotted currentColor;
    font-size: 14px;
    line-height: 1;
}

.site-footer {
    padding: clamp(22px, 3vw, 34px);
    margin-top: 30px;
}

.footer-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 3px dotted var(--voxel-black);
}

.footer-title {
    margin: 0;
    font-size: 28px;
    line-height: 1;
}

.footer-tagline {
    max-width: 620px;
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.35;
}

.footer-note {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1.2;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.footer-column h2 {
    margin: 0 0 12px;
    font-size: 19px;
    line-height: 1;
}

.footer-column ul {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-link {
    color: var(--voxel-black);
    font-size: 15px;
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.footer-link:hover {
    color: var(--voxel-white);
    background: var(--voxel-black);
    text-decoration: none;
}

.route-shell {
    width: min(720px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
    display: grid;
    align-content: center;
    gap: 20px;
}

.route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
}

.route-logo {
    display: block;
    width: min(260px, 60vw);
    height: auto;
    image-rendering: pixelated;
}

[hidden] {
    display: none !important;
}

.route-card {
    padding: clamp(22px, 5vw, 42px);
}

.route-eyebrow {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.route-title {
    margin: 0;
    font-size: clamp(30px, 8vw, 52px);
    line-height: 1;
}

.route-copy {
    max-width: 620px;
    margin: 18px 0 0;
    font-size: clamp(17px, 3vw, 20px);
    line-height: 1.35;
}

.route-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
}

.route-note {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 3px dotted var(--voxel-black);
    font-size: 14px;
    line-height: 1.3;
}

.account-status {
    min-height: 1.4em;
    margin: 18px 0 0;
    font-size: 16px;
    line-height: 1.35;
}

.account-status[data-kind="error"] {
    padding: 10px;
    color: var(--voxel-white);
    background: var(--voxel-black);
}

.account-status[data-kind="success"] {
    border: 3px solid var(--voxel-black);
    padding: 10px;
}

.account-google-button {
    min-height: 44px;
    margin-top: 18px;
}

.account-form {
    display: grid;
    gap: 18px;
}

.account-field {
    display: grid;
    gap: 7px;
    font-size: 17px;
    line-height: 1.25;
}

.account-field small {
    font-size: 13px;
    line-height: 1.3;
}

.account-input {
    width: 100%;
    min-height: 48px;
    border: 3px solid var(--voxel-black);
    border-radius: 0;
    padding: 8px 10px;
    color: var(--voxel-black);
    background: var(--voxel-white);
    font: 400 19px/1 "Voxel UI", ui-monospace, monospace;
    box-sizing: border-box;
}

.account-input:focus {
    outline: 3px solid var(--voxel-black);
    outline-offset: 3px;
}

.account-checkbox {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    font-size: 16px;
    line-height: 1.35;
}

.account-checkbox input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--voxel-black);
}

.account-profile-name {
    margin: 16px 0 0;
    font-size: clamp(18px, 4vw, 24px);
}

.account-world-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.account-world-slot {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
    border: 4px solid var(--voxel-black);
    padding: 18px;
    background: var(--voxel-white);
    box-shadow: var(--voxel-shadow);
}

.account-world-title,
.account-world-copy {
    margin: 0;
}

.account-world-title {
    font-size: 22px;
}

.account-world-copy {
    flex: 1;
    font-size: 15px;
    line-height: 1.35;
}

.account-delete-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 3px dotted var(--voxel-black);
}

.account-danger-button {
    color: var(--voxel-white);
    background: var(--voxel-black);
}

@media (max-width: 1180px) {
    .world-grid--public {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .homepage-shell {
        width: min(100% - 30px, 720px);
        padding-top: 18px;
    }

    .site-header,
    .hero-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .site-header {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-link {
        flex-basis: auto;
    }

    .site-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .world-grid,
    .world-grid--public {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .homepage-shell {
        width: calc(100% - 20px);
        padding: 10px 0 34px;
    }

    .miniwelt-page {
        background-attachment: scroll;
    }

    .pixel-panel {
        box-shadow:
            0 0 0 2px var(--voxel-white),
            6px 7px 0 var(--voxel-shadow);
    }

    .site-header,
    .hero-panel,
    .world-section,
    .site-footer {
        padding: 16px;
    }

    .site-header {
        gap: 16px;
        margin-bottom: 20px;
    }

    .route-header {
        gap: 8px;
        padding: 12px;
    }

    .route-header .brand-link {
        min-width: 0;
    }

    .route-header .route-logo {
        width: min(260px, calc(100vw - 150px));
    }

    .brand-logo {
        width: 260px;
    }

    .site-nav,
    .hero-actions,
    .world-grid,
    .world-grid--public,
    .footer-grid,
    .voxel-menu-grid,
    .route-actions,
    .account-world-grid,
    .account-delete-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-heading,
    .footer-intro {
        align-items: start;
        flex-direction: column;
    }

    .section-count,
    .footer-note {
        white-space: normal;
    }

    .hero-title {
        font-size: clamp(34px, 12vw, 48px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .world-card,
    .voxel-menu-button {
        transition: none;
    }
}
