/*
 * Nebelmeer Theme Prototype
 *
 * Naming:
 * - nm-*             shared Nebelmeer UI/component classes
 * - nm-block__part   component elements
 * - is-*             visual/interactive state classes
 */

:root {
    --nm-color-bg: #102a30;
    --nm-color-harbor: #0e2830;
    --nm-color-harbor-light: #22565b;
    --nm-color-gold: #aa874b;
    --nm-color-gold-light: #fce29f;
    --nm-color-paper: #f8f0df;
    --nm-color-shadow: #041116;
    --nm-radius-panel: .95rem;
    --nm-radius-menu: 1rem;
    --nm-radius-control: .7rem;
    --nm-width-page: 1440px;
    --nm-width-page-wide: 1800px;
    --nm-backdrop-blur: .7rem;
    --nm-z-background: 0;
    --nm-z-content: 12;
    --nm-z-navigation: 20;
    --nm-z-tooltip: 80;
    --nm-z-modal: 90;
}

/* Base */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    color: var(--nm-color-paper);
    background: var(--nm-color-bg);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Background Slideshow */

.nm-bg {
    position: fixed;
    inset: 0;
    z-index: var(--nm-z-background);
    isolation: isolate;
    overflow: hidden;
    pointer-events: none;
    background: var(--nm-color-bg);
}

.nm-bg__slide {
    position: absolute;
    inset: -6vmax;
    z-index: 1;
    opacity: 0;
    background-image: var(--image);
    background-position: center;
    background-size: cover;
    transform:
        translate3d(var(--start-x, 4%), var(--start-y, 0), 0)
        scale(var(--start-scale, 1.06))
        rotate(var(--start-rotate, 0deg));
    transform-origin: var(--origin, center);
    transition: opacity 2800ms ease;
    will-change: opacity, transform;
}

.nm-bg__slide.is-active {
    z-index: 3;
    opacity: 1;
    animation: nm-bg-drift 22000ms cubic-bezier(.33, 0, .2, 1) forwards;
}

.nm-bg__slide.is-leaving {
    z-index: 2;
    opacity: 0;
    animation: nm-bg-drift-out 4200ms ease forwards;
}

.nm-bg__slide:nth-child(1) {
    --origin: 44% 54%;
    --start-x: -.7%;
    --start-y: .35%;
    --start-scale: 1.065;
    --start-rotate: -.12deg;
    --end-x: .9%;
    --end-y: -.45%;
    --end-scale: 1.095;
    --end-rotate: .16deg;
    --leave-x: 1.2%;
    --leave-y: -.65%;
    --leave-scale: 1.105;
    --leave-rotate: .2deg;
}

.nm-bg__slide:nth-child(2) {
    --origin: 58% 46%;
    --start-x: .85%;
    --start-y: -.35%;
    --start-scale: 1.07;
    --start-rotate: .14deg;
    --end-x: -.85%;
    --end-y: .65%;
    --end-scale: 1.1;
    --end-rotate: -.18deg;
    --leave-x: -1.15%;
    --leave-y: .85%;
    --leave-scale: 1.11;
    --leave-rotate: -.22deg;
}

.nm-bg__slide:nth-child(3) {
    --origin: 50% 58%;
    --start-x: .35%;
    --start-y: .75%;
    --start-scale: 1.06;
    --start-rotate: -.1deg;
    --end-x: -.9%;
    --end-y: -.35%;
    --end-scale: 1.09;
    --end-rotate: .14deg;
    --leave-x: -1.15%;
    --leave-y: -.55%;
    --leave-scale: 1.1;
    --leave-rotate: .18deg;
}

.nm-bg__slide:nth-child(4) {
    --origin: 42% 44%;
    --start-x: -.6%;
    --start-y: -.65%;
    --start-scale: 1.065;
    --start-rotate: .12deg;
    --end-x: .8%;
    --end-y: .5%;
    --end-scale: 1.095;
    --end-rotate: -.16deg;
    --leave-x: 1.05%;
    --leave-y: .7%;
    --leave-scale: 1.105;
    --leave-rotate: -.2deg;
}

@keyframes nm-bg-drift {
    from {
        transform:
            translate3d(var(--start-x), var(--start-y), 0)
            scale(var(--start-scale))
            rotate(var(--start-rotate));
    }

    to {
        transform:
            translate3d(var(--end-x), var(--end-y), 0)
            scale(var(--end-scale))
            rotate(var(--end-rotate));
    }
}

@keyframes nm-bg-drift-out {
    from {
        transform:
            translate3d(var(--end-x), var(--end-y), 0)
            scale(var(--end-scale))
            rotate(var(--end-rotate));
    }

    to {
        transform:
            translate3d(var(--leave-x), var(--leave-y), 0)
            scale(var(--leave-scale))
            rotate(var(--leave-rotate));
    }
}

@keyframes nm-logo-aura {
    0% {
        opacity: 0;
        transform: scale(.92) rotate(-18deg);
    }

    55% {
        opacity: .78;
        transform: scale(1.08) rotate(12deg);
    }

    100% {
        opacity: .42;
        transform: scale(1.04) rotate(24deg);
    }
}

.nm-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(10, 30, 35, .1), rgba(10, 30, 35, .04) 38%, rgba(10, 30, 35, .24)),
        linear-gradient(90deg, rgba(10, 30, 35, .18), transparent 22%, transparent 78%, rgba(10, 30, 35, .18));
}

/* Topbar */

.nm-topbar {
    --nm-edge-padding: 24px;
    --nm-logo-size: clamp(6.2rem, 8vw, 8.6rem);
    position: fixed;
    top: calc(60px + env(safe-area-inset-top));
    left: 50%;
    z-index: var(--nm-z-navigation);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-items: center;
    width: min(var(--nm-width-page), calc(100% - 2rem));
    min-height: 3.45rem;
    padding: .35rem 0;
    border: 1px solid rgba(252, 226, 159, .56);
    border-bottom-color: rgba(170, 135, 75, .82);
    border-radius: var(--nm-radius-panel);
    background:
        linear-gradient(135deg, rgba(34, 86, 91, .92), rgba(14, 40, 48, .96) 48%, rgba(14, 40, 48, .92)),
        var(--nm-color-harbor);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .2),
        inset 0 -1px 0 rgba(170, 135, 75, .36),
        0 1rem 2.5rem rgba(4, 17, 22, .34);
    transform: translateX(-50%);
    backdrop-filter: blur(var(--nm-backdrop-blur));
}

.nm-topbar__resource-toggle {
    display: none;
    grid-column: 1;
    align-items: center;
    justify-self: start;
    gap: .5rem;
    min-height: 2.35rem;
    margin-left: var(--nm-edge-padding);
    padding: .34rem .72rem;
    border: 1px solid rgba(252, 226, 159, .32);
    border-radius: .7rem;
    color: #fce29f;
    background:
        linear-gradient(145deg, rgba(252, 226, 159, .12), rgba(14, 40, 48, .22)),
        rgba(8, 27, 34, .48);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .1),
        0 .3rem .8rem rgba(4, 17, 22, .22);
    cursor: pointer;
    font: inherit;
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .03em;
    line-height: 1;
    text-transform: uppercase;
}

.nm-topbar__resource-toggle img {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.nm-topbar__resource-toggle:hover,
.nm-topbar__resource-toggle:focus-visible,
.nm-topbar.is-resources-open .nm-topbar__resource-toggle {
    border-color: rgba(252, 226, 159, .68);
    background:
        linear-gradient(145deg, rgba(252, 226, 159, .18), rgba(14, 40, 48, .18)),
        rgba(8, 27, 34, .62);
    outline: none;
}

.nm-topbar__materials {
    position: relative;
    z-index: 1;
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    align-items: center;
    justify-self: stretch;
    width: 100%;
    gap: .18rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-left: var(--nm-edge-padding);
    padding-right: calc((var(--nm-logo-size) / 2) + var(--nm-edge-padding));
    scrollbar-width: none;
}

.nm-topbar__materials::-webkit-scrollbar {
    display: none;
}

.nm-topbar__material {
    appearance: none;
    position: relative;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 2.08rem;
    place-items: center;
    gap: .08rem;
    padding: .16rem .24rem .16rem .16rem;
    border: 1px solid transparent;
    border-radius: .62rem;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.nm-topbar__material img {
    width: 1.68rem;
    height: 1.68rem;
    object-fit: contain;
    filter: drop-shadow(0 .16rem .22rem rgba(4, 17, 22, .32));
}

.nm-topbar__material:hover,
.nm-topbar__material:focus-visible {
    border-color: rgba(252, 226, 159, .42);
    background: transparent;
    outline: none;
}

.nm-topbar__material:hover img,
.nm-topbar__material:focus-visible img {
    transform: translateY(-.04rem) scale(1.04);
}

.nm-topbar__material strong {
    min-width: .82rem;
    color: #fce29f;
    font-size: .78rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: right;
    text-shadow: 0 .12rem .22rem rgba(4, 17, 22, .58);
}

.nm-topbar__material--loading {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    justify-content: center;
    color: rgba(248, 240, 223, .68);
    font-size: .78rem;
    font-weight: 800;
}

.nm-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    width: var(--nm-logo-size);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(252, 226, 159, .78);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 40%, rgba(252, 226, 159, .22), transparent 50%),
        linear-gradient(145deg, rgba(252, 226, 159, .2), rgba(170, 135, 75, .08)),
        rgba(14, 40, 48, .82);
    box-shadow:
        inset 0 0 0 .18rem rgba(14, 40, 48, .78),
        inset 0 0 0 .26rem rgba(252, 226, 159, .28),
        0 .65rem 1.4rem rgba(4, 17, 22, .36);
    transform: translate(-50%, -50%);
    transition:
        border-color 360ms ease,
        box-shadow 360ms ease,
        transform 360ms cubic-bezier(.2, .8, .2, 1);
}

.nm-logo::before {
    content: "";
    position: absolute;
    inset: -.45rem;
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    background:
        conic-gradient(from 45deg, transparent, rgba(252, 226, 159, .72), transparent 38%, rgba(170, 135, 75, .5), transparent 72%);
    filter: blur(.08rem);
    transition: opacity 360ms ease;
}

.nm-logo:hover,
.nm-logo:focus-visible {
    border-color: rgba(252, 226, 159, .98);
    box-shadow:
        inset 0 0 0 .18rem rgba(14, 40, 48, .78),
        inset 0 0 0 .26rem rgba(252, 226, 159, .38),
        0 .8rem 1.65rem rgba(4, 17, 22, .4),
        0 0 2rem rgba(252, 226, 159, .24);
    outline: none;
    transform: translate(-50%, -54%) scale(1.035);
}

.nm-logo:hover::before,
.nm-logo:focus-visible::before {
    opacity: 1;
    animation: nm-logo-aura 900ms cubic-bezier(.2, .8, .2, 1) 1 both;
}

.nm-logo img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 .35rem .5rem rgba(4, 17, 22, .32));
    transition: filter 360ms ease, transform 360ms cubic-bezier(.2, .8, .2, 1);
}

.nm-logo:hover img,
.nm-logo:focus-visible img {
    filter:
        drop-shadow(0 .35rem .5rem rgba(4, 17, 22, .36))
        drop-shadow(0 0 .7rem rgba(252, 226, 159, .22));
    transform: scale(1.035);
}

.nm-topbar__account {
    position: relative;
    z-index: 4;
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-self: stretch;
    justify-content: flex-end;
    min-width: 0;
    gap: .36rem;
    padding-left: calc((var(--nm-logo-size) / 2) + var(--nm-edge-padding));
    padding-right: var(--nm-edge-padding);
}

.nm-topbar__currencies {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    gap: .36rem;
}

.nm-topbar__materials .resource-icon,
.nm-topbar__currencies .resource-icon {
    width: 1.68rem;
    height: 1.68rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    filter: drop-shadow(0 .16rem .22rem rgba(4, 17, 22, .32));
}

.nm-currency {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    min-height: 2.08rem;
    gap: .08rem;
    padding: .16rem .28rem .16rem .16rem;
    border: 1px solid rgba(252, 226, 159, .26);
    border-radius: .62rem;
    background:
        linear-gradient(145deg, rgba(252, 226, 159, .12), rgba(14, 40, 48, .28)),
        rgba(8, 27, 34, .48);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .11),
        0 .32rem .8rem rgba(4, 17, 22, .22);
    font-variant-numeric: tabular-nums;
}

.nm-currency img {
    width: 1.68rem;
    height: 1.68rem;
    object-fit: contain;
    filter: drop-shadow(0 .16rem .22rem rgba(4, 17, 22, .32));
}

.nm-currency strong {
    min-width: 1.9rem;
    color: #fce29f;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    text-align: right;
    text-shadow: 0 .12rem .22rem rgba(4, 17, 22, .58);
}

.nm-currency--loading {
    grid-template-columns: 1fr;
    color: rgba(248, 240, 223, .68);
    font-size: .78rem;
    font-weight: 800;
}

.nm-user-menu {
    position: relative;
    min-width: 0;
}

.nm-user-menu__toggle {
    display: inline-grid;
    grid-template-columns: auto minmax(0, auto) auto;
    align-items: center;
    max-width: 13.2rem;
    min-height: 2.35rem;
    gap: .42rem;
    padding: .22rem .42rem .22rem .3rem;
    border: 1px solid rgba(252, 226, 159, .32);
    border-radius: .72rem;
    color: rgba(248, 240, 223, .88);
    background:
        linear-gradient(145deg, rgba(252, 226, 159, .13), rgba(14, 40, 48, .22)),
        rgba(8, 27, 34, .54);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .1),
        0 .32rem .8rem rgba(4, 17, 22, .22);
    cursor: pointer;
    font: inherit;
}

.nm-user-menu__toggle:hover,
.nm-user-menu__toggle:focus-visible,
.nm-user-menu.is-open .nm-user-menu__toggle {
    border-color: rgba(252, 226, 159, .68);
    background:
        linear-gradient(145deg, rgba(252, 226, 159, .18), rgba(14, 40, 48, .18)),
        rgba(8, 27, 34, .66);
    outline: none;
}

.nm-user-menu__toggle > img:first-child {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid rgba(252, 226, 159, .24);
    border-radius: 50%;
    padding: .18rem;
    background: rgba(8, 27, 34, .38);
}

.nm-user-menu__toggle span {
    overflow: hidden;
    color: #fce29f;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-user-menu__toggle > img:last-child {
    width: .95rem;
    height: .95rem;
    opacity: .82;
    transition: transform 160ms ease;
}

.nm-user-menu.is-open .nm-user-menu__toggle > img:last-child {
    transform: rotate(180deg);
}

.nm-user-menu__dropdown {
    position: absolute;
    top: calc(100% + .72rem);
    right: 0;
    display: none;
    width: min(15.5rem, calc(100vw - 2rem));
    padding: .5rem;
    border: 1px solid rgba(252, 226, 159, .48);
    border-radius: .9rem;
    background:
        linear-gradient(145deg, rgba(34, 86, 91, .96), rgba(14, 40, 48, .98)),
        #0e2830;
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .14),
        0 1rem 2.1rem rgba(4, 17, 22, .38);
}

.nm-user-menu.is-open .nm-user-menu__dropdown {
    display: grid;
    animation: nm-popover-in 180ms ease both;
}

.nm-user-menu__dropdown a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .52rem;
    min-height: 2.45rem;
    padding: .36rem .48rem;
    border: 1px solid transparent;
    border-radius: .62rem;
    color: rgba(248, 240, 223, .86);
    font-size: .82rem;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
}

.nm-user-menu__dropdown a:hover,
.nm-user-menu__dropdown a:focus-visible {
    color: #fce29f;
    border-color: rgba(252, 226, 159, .28);
    background: rgba(252, 226, 159, .08);
    outline: none;
}

.nm-user-menu__dropdown img {
    width: 1.1rem;
    height: 1.1rem;
    opacity: .9;
}

/* Bottom Navigation */

.nm-bottom-nav {
    --nm-bottom-width: min(var(--nm-width-page), calc(100% - 2rem));
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: var(--nm-z-navigation);
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: center;
    width: var(--nm-bottom-width);
    min-height: 4.65rem;
    gap: .28rem;
    padding: .42rem;
    border: 1px solid rgba(252, 226, 159, .5);
    border-top-color: rgba(252, 226, 159, .64);
    border-radius: 1rem;
    background:
        linear-gradient(135deg, rgba(34, 86, 91, .9), rgba(14, 40, 48, .96) 52%, rgba(14, 40, 48, .9)),
        var(--nm-color-harbor);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .16),
        inset 0 -1px 0 rgba(170, 135, 75, .26),
        0 -1rem 2.4rem rgba(4, 17, 22, .32);
    transform: translateX(-50%);
    backdrop-filter: blur(var(--nm-backdrop-blur));
}

.nm-bottom-nav__link {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    min-width: 0;
    min-height: 3.65rem;
    place-items: center;
    align-content: center;
    gap: .16rem;
    padding: .28rem .34rem;
    border: 1px solid transparent;
    border-radius: .78rem;
    color: rgba(248, 240, 223, .78);
    font-size: .76rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.nm-bottom-nav__link::before {
    content: "";
    position: absolute;
    inset: .18rem;
    z-index: -1;
    border-radius: .66rem;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(252, 226, 159, .18), transparent 62%),
        rgba(252, 226, 159, .06);
    transition: opacity 180ms ease;
}

.nm-bottom-nav__link img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    filter:
        drop-shadow(0 .2rem .28rem rgba(4, 17, 22, .36))
        saturate(.96);
    transition:
        filter 180ms ease,
        transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.nm-bottom-nav__link span {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
}

.nm-bottom-nav__link:hover,
.nm-bottom-nav__link:focus-visible,
.nm-bottom-nav__link.is-active {
    color: #fce29f;
    border-color: rgba(252, 226, 159, .34);
    background: rgba(8, 27, 34, .32);
    outline: none;
}

.nm-bottom-nav__link:hover::before,
.nm-bottom-nav__link:focus-visible::before,
.nm-bottom-nav__link.is-active::before {
    opacity: 1;
}

.nm-bottom-nav__link:hover img,
.nm-bottom-nav__link:focus-visible img,
.nm-bottom-nav__link.is-active img {
    filter:
        drop-shadow(0 .22rem .3rem rgba(4, 17, 22, .4))
        drop-shadow(0 0 .58rem rgba(252, 226, 159, .22))
        saturate(1.08);
    transform: translateY(-.08rem) scale(1.04);
}

/* Main Layout */

.nm-main-layout {
    --nm-content-width: min(var(--nm-width-page), calc(100% - 2rem));
    position: fixed;
    top: calc(10.45rem + env(safe-area-inset-top));
    bottom: calc(7.35rem + env(safe-area-inset-bottom));
    left: 50%;
    z-index: var(--nm-z-content);
    display: grid;
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
    width: var(--nm-content-width);
    min-height: 0;
    gap: 1rem;
    transform: translateX(-50%);
}

.nm-panel {
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(252, 226, 159, .42);
    border-radius: var(--nm-radius-panel);
    background:
        linear-gradient(135deg, rgba(34, 86, 91, .72), rgba(14, 40, 48, .9) 50%, rgba(9, 28, 35, .86)),
        rgba(14, 40, 48, .76);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .12),
        inset 0 -1px 0 rgba(170, 135, 75, .2),
        0 1rem 2.2rem rgba(4, 17, 22, .3);
    backdrop-filter: blur(.62rem);
}

.nm-main-layout.nm-main-layout--game {
    grid-template-columns: minmax(0, 1fr);
}

.nm-game-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    padding: 1rem;
}

.nm-game-panel .page-content {
    min-height: 0;
    overflow: auto;
    padding: .05rem .25rem .4rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 226, 159, .32) transparent;
}

.nm-game-panel .page-header h1,
.nm-game-panel .section-heading h2,
.nm-game-panel .card-topline h2,
.nm-game-panel .card-topline h3 {
    color: var(--nm-color-gold-light);
}

.nm-game-panel .page-header p:last-child,
.nm-game-panel .empty-note,
.nm-game-panel .contract-meta,
.nm-game-panel .card-topline span {
    color: rgba(248, 240, 223, .68);
}

.nm-game-panel .building-card,
.nm-game-panel .contract-card,
.nm-game-panel .island-card,
.nm-game-panel .recipe-card,
.nm-game-panel .queue-panel,
.nm-game-panel .recipe-panel,
.nm-game-panel .harbor-panel {
    border-color: rgba(252, 226, 159, .24);
    color: rgba(248, 240, 223, .86);
    background:
        linear-gradient(150deg, rgba(8, 27, 34, .58), rgba(14, 40, 48, .42)),
        rgba(6, 21, 27, .32);
    box-shadow: inset 0 1px 0 rgba(252, 226, 159, .08);
}

.nm-game-panel .harbor-brief {
    border-color: rgba(252, 226, 159, .3);
    color: rgba(248, 240, 223, .88);
    background:
        linear-gradient(135deg, rgba(34, 86, 91, .72), rgba(14, 40, 48, .88)),
        rgba(14, 40, 48, .76);
}

.nm-game-panel .text-button,
.nm-game-panel .button-link {
    color: var(--nm-color-gold-light);
}

.nm-game-panel button,
.nm-game-panel .primary-action-button {
    color: var(--nm-color-harbor);
    background: linear-gradient(135deg, var(--nm-color-gold-light), var(--nm-color-gold));
}

.nm-game-panel button:hover:not(:disabled),
.nm-game-panel .primary-action-button:hover {
    filter: brightness(1.07);
    background: linear-gradient(135deg, var(--nm-color-gold-light), var(--nm-color-gold));
}

.nm-game-panel button:disabled {
    color: rgba(248, 240, 223, .7);
    background: rgba(4, 17, 22, .34);
}

.nm-game-panel input {
    color: var(--nm-color-paper);
    border-color: rgba(252, 226, 159, .28);
    background: rgba(4, 17, 22, .32);
}

/* Game Content Bridge */

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: calc(var(--nm-z-navigation) + 5);
    padding: .48rem .7rem;
    border: 1px solid rgba(252, 226, 159, .42);
    border-radius: .7rem;
    color: var(--nm-color-gold-light);
    background: rgba(8, 27, 34, .94);
}

.skip-link:focus {
    top: 1rem;
}

.nm-game-panel h1,
.nm-game-panel h2,
.nm-game-panel h3,
.nm-game-panel p {
    margin: 0;
}

.nm-game-panel button,
.nm-game-panel input {
    font: inherit;
}

.nm-game-panel button {
    min-height: 2.55rem;
    border: 0;
    border-radius: .7rem;
    padding: 0 .9rem;
    cursor: pointer;
    font-weight: 900;
}

.nm-game-panel button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.nm-game-panel button:focus-visible,
.nm-game-panel input:focus-visible,
.nm-game-panel a:focus-visible,
.nm-game-panel .page-content:focus-visible {
    outline: 2px solid rgba(252, 226, 159, .7);
    outline-offset: 2px;
}

.nm-game-panel .page-content {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.nm-game-panel .page-header {
    display: grid;
    gap: .42rem;
    max-width: 56rem;
    padding: .15rem 0 .2rem;
}

.nm-game-panel .page-header h1 {
    font-size: clamp(1.9rem, 4vw, 3.15rem);
    line-height: 1;
    letter-spacing: 0;
}

.nm-game-panel .eyebrow {
    color: rgba(252, 226, 159, .76);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.nm-game-panel .empty-note {
    color: rgba(248, 240, 223, .68);
    font-weight: 700;
}

.summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
}

.summary-strip span {
    min-height: 2.15rem;
    padding: .42rem .62rem;
    border: 1px solid rgba(252, 226, 159, .2);
    border-radius: .68rem;
    color: rgba(248, 240, 223, .72);
    background: rgba(4, 17, 22, .24);
}

.harbor-brief {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(14rem, .72fr);
    grid-template-areas:
        "copy map"
        "ledger ledger";
    gap: 1rem;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 2.2rem);
    border: 1px solid rgba(252, 226, 159, .3);
    border-radius: var(--nm-radius-panel);
    box-shadow: inset 0 1px 0 rgba(252, 226, 159, .08);
}

.harbor-brief__copy,
.harbor-brief__map,
.harbor-ledger {
    position: relative;
}

.harbor-brief__copy {
    grid-area: copy;
    display: grid;
    align-content: center;
    gap: .75rem;
    min-width: 0;
}

.harbor-brief h1 {
    max-width: 12ch;
    color: var(--nm-color-gold-light);
    font-size: clamp(2.25rem, 5vw, 4.45rem);
    line-height: .96;
    overflow-wrap: anywhere;
}

.harbor-brief__copy > p:last-of-type {
    max-width: 41rem;
    color: rgba(248, 240, 223, .72);
    font-weight: 650;
    line-height: 1.45;
}

.harbor-brief__map {
    grid-area: map;
    align-self: stretch;
    min-height: 12rem;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(252, 226, 159, .22);
    border-radius: .8rem;
    background: rgba(4, 17, 22, .26);
}

.harbor-brief__map img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}

.harbor-ledger {
    grid-area: ledger;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
    margin: 0;
}

.harbor-ledger > div {
    min-width: 0;
    padding: .75rem;
    border-top: 2px solid rgba(252, 226, 159, .42);
    border-radius: .68rem;
    background: rgba(4, 17, 22, .24);
}

.harbor-ledger dt {
    color: rgba(248, 240, 223, .58);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.harbor-ledger dd {
    margin: .16rem 0 0;
    color: var(--nm-color-gold-light);
    font-size: clamp(1.15rem, 2.2vw, 1.65rem);
    font-weight: 950;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.action-lane {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "step main"
        "step metric";
    align-items: center;
    min-height: 7rem;
    gap: .18rem .72rem;
    padding: .9rem;
    border: 1px solid rgba(252, 226, 159, .2);
    border-radius: .78rem;
    color: rgba(248, 240, 223, .84);
    background:
        linear-gradient(150deg, rgba(8, 27, 34, .54), rgba(14, 40, 48, .34)),
        rgba(6, 21, 27, .28);
    text-decoration: none;
}

.action-card:hover,
.action-card:focus-visible {
    border-color: rgba(252, 226, 159, .46);
    color: var(--nm-color-gold-light);
    outline: none;
}

.action-card__step {
    grid-area: step;
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: .62rem;
    color: var(--nm-color-harbor);
    background: linear-gradient(135deg, var(--nm-color-gold-light), var(--nm-color-gold));
    font-size: .82rem;
    font-weight: 950;
}

.action-card__main {
    grid-area: main;
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.action-card__main strong,
.action-card__main span,
.action-card__metric {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-card__main span {
    color: rgba(248, 240, 223, .62);
    font-size: .86rem;
}

.action-card__metric {
    grid-area: metric;
    color: var(--nm-color-gold-light);
    font-weight: 950;
}

.dashboard-board,
.building-grid,
.contract-list,
.island-grid,
.recipe-book,
.job-list,
.queue-groups,
.compact-section,
.snapshot-list {
    display: grid;
    gap: .75rem;
}

.harbor-columns,
.production-layout {
    display: grid;
    gap: 1rem;
}

.harbor-panel,
.building-card,
.contract-card,
.island-card,
.fleet-goal,
.queue-panel,
.recipe-panel,
.queue-group,
.recipe-card,
.job-row {
    min-width: 0;
    border: 1px solid rgba(252, 226, 159, .22);
    border-radius: .78rem;
}

.harbor-panel,
.building-card,
.contract-card,
.fleet-goal,
.queue-group,
.recipe-card {
    display: grid;
    gap: .75rem;
    padding: .9rem;
}

.section-heading,
.card-topline {
    display: grid;
    gap: .24rem;
    min-width: 0;
}

.card-topline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
}

.card-topline h2,
.card-topline h3 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.card-topline span {
    color: rgba(252, 226, 159, .74);
    font-size: .84rem;
    font-weight: 900;
    white-space: nowrap;
}

.card-actions,
.fleet-actions,
.queue-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.primary-dock-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: .5rem;
    margin-top: .35rem;
    padding: .34rem;
    border: 1px solid rgba(252, 226, 159, .2);
    border-radius: .72rem;
    background: rgba(4, 17, 22, .28);
}

.primary-dock-action > span {
    padding-inline: .42rem;
    color: rgba(248, 240, 223, .72);
    font-weight: 850;
}

.primary-action-button,
.button-link.primary-action-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    padding: 0 .9rem;
    border-radius: .7rem;
    font-weight: 900;
    text-decoration: none;
}

.text-button {
    justify-self: start;
    border: 1px solid rgba(252, 226, 159, .2);
    background: rgba(4, 17, 22, .28);
}

.contract-meta,
.speaker,
.cost-line,
.recipe-row span,
.job-row span,
.snapshot-row span,
.snapshot-line span {
    color: rgba(248, 240, 223, .64);
}

.building-work-state,
.compact-queue-row,
.recipe-row,
.snapshot-line,
.snapshot-row {
    display: grid;
    gap: .48rem;
    padding: .62rem;
    border: 1px solid rgba(252, 226, 159, .14);
    border-radius: .68rem;
    background: rgba(4, 17, 22, .24);
}

.building-work-line,
.snapshot-line,
.snapshot-row,
.compact-queue-row,
.recipe-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.work-badge,
.job-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: .18rem .48rem;
    border-radius: .6rem;
    color: var(--nm-color-harbor);
    background: linear-gradient(135deg, var(--nm-color-gold-light), var(--nm-color-gold));
    font-size: .78rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.queue-panel,
.recipe-panel {
    display: grid;
    align-content: start;
    gap: .75rem;
    padding: .9rem;
}

.job-row {
    grid-template-columns: 1fr;
}

.job-row-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
}

.recipe-actions {
    display: grid;
    grid-template-columns: minmax(5rem, 7rem) auto;
    align-items: end;
    gap: .55rem;
}

.recipe-actions label {
    display: grid;
    gap: .25rem;
    color: rgba(248, 240, 223, .64);
    font-size: .86rem;
}

.recipe-actions input,
.fleet-actions input {
    min-height: 2.55rem;
    width: 100%;
    border: 1px solid rgba(252, 226, 159, .22);
    border-radius: .68rem;
    padding: 0 .72rem;
}

.recipe-flow,
.amount-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .42rem;
    min-width: 0;
}

.amount-list--empty {
    color: rgba(248, 240, 223, .58);
}

.resource-chip {
    --resource-accent: var(--nm-color-gold-light);
    --resource-line: rgba(252, 226, 159, .22);
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 2rem;
    gap: .35rem;
    padding: .18rem .55rem .18rem .24rem;
    border: 1px solid var(--resource-line);
    border-radius: .64rem;
    color: rgba(248, 240, 223, .78);
    background: transparent;
}

.resource-chip strong {
    color: var(--resource-accent);
    font-variant-numeric: tabular-nums;
}

.resource-chip > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.resource-chip--compact {
    min-height: 1.75rem;
    padding-right: .5rem;
    font-size: .84rem;
}

.resource-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    border-radius: 0;
    color: var(--resource-accent, var(--nm-color-gold-light));
    background: transparent;
}

.resource-icon svg {
    width: 1rem;
    height: 1rem;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.resource-icon img {
    width: calc(100% - .18rem);
    height: calc(100% - .18rem);
    object-fit: contain;
}

.progress-track {
    overflow: hidden;
    height: .55rem;
    border: 1px solid rgba(252, 226, 159, .16);
    border-radius: 999px;
    background: rgba(4, 17, 22, .32);
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--nm-color-gold), var(--nm-color-gold-light));
}

.island-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    padding: .9rem;
}

.island-card.is-locked {
    opacity: .7;
}

.route-mark {
    width: .7rem;
    height: 100%;
    min-height: 4rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--nm-color-gold-light), var(--nm-color-gold));
}

.inventory-grid-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 1rem;
}

.inventory-category-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: start;
    gap: .78rem;
    height: 100%;
    padding: .9rem;
    border: 1px solid rgba(252, 226, 159, .16);
    border-radius: .78rem;
    background:
        linear-gradient(150deg, rgba(8, 27, 34, .24), rgba(14, 40, 48, .14)),
        rgba(6, 21, 27, .12);
    box-shadow: inset 0 1px 0 rgba(252, 226, 159, .05);
}

.inventory-section-heading {
    display: block;
    padding-bottom: .62rem;
    border-bottom: 1px solid rgba(252, 226, 159, .14);
}

.inventory-section-heading > div {
    min-width: 0;
}

.inventory-section-heading h2 {
    color: var(--nm-color-gold-light);
    font-size: clamp(1.16rem, 2vw, 1.48rem);
    line-height: 1;
}

.inventory-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.9rem, 1fr));
    align-content: start;
    gap: .52rem;
}

.inventory-slot {
    --resource-accent: var(--nm-color-gold-light);
    --resource-line: rgba(252, 226, 159, .38);
    appearance: none;
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    gap: .18rem;
    padding: .58rem .42rem .46rem;
    border: 1.5px solid var(--resource-line);
    border-radius: .72rem;
    color: rgba(248, 240, 223, .8);
    background: rgba(4, 17, 22, .08);
    cursor: pointer;
    font: inherit;
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        filter 160ms ease;
}

.nm-game-panel .inventory-slot {
    border: 2px solid rgba(252, 226, 159, .46);
    color: rgba(248, 240, 223, .8);
    background: rgba(4, 17, 22, .08);
}

.inventory-slot.is-empty {
    opacity: .58;
}

.inventory-slot:hover,
.inventory-slot:focus-visible {
    border-color: rgba(252, 226, 159, .68);
    filter: brightness(1.06);
    outline: none;
    transform: translateY(-.05rem);
}

.nm-game-panel .inventory-slot:hover:not(:disabled),
.nm-game-panel .inventory-slot:focus-visible {
    border-color: rgba(252, 226, 159, .76);
    background: rgba(252, 226, 159, .055);
    filter: brightness(1.06);
}

.inventory-slot .resource-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(2.9rem, 6.2vw, 4.15rem);
    height: clamp(2.9rem, 6.2vw, 4.15rem);
    filter: drop-shadow(0 .18rem .24rem rgba(4, 17, 22, .34));
    transform: translate(-50%, -50%);
}

.inventory-slot .resource-icon img {
    width: 100%;
    height: 100%;
}

.inventory-slot strong {
    position: absolute;
    right: .36rem;
    bottom: .34rem;
    min-width: 1.5rem;
    padding: .13rem .28rem;
    border: 1px solid rgba(252, 226, 159, .18);
    border-radius: .5rem;
    color: var(--resource-accent);
    background: rgba(4, 17, 22, .58);
    box-shadow: 0 .18rem .32rem rgba(4, 17, 22, .18);
    font-size: .72rem;
    font-weight: 950;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.inventory-slot > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.resource-tooltip {
    position: fixed;
    opacity: 0;
    pointer-events: none;
    transform: translateY(.18rem);
    transition: opacity 150ms ease, transform 150ms ease;
}

.resource-tooltip[data-visible="true"] {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 760px) {
    .harbor-columns,
    .production-layout {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        align-items: start;
    }

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

@media (min-width: 820px) {
    .dashboard-board {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) minmax(0, .92fr);
        align-items: start;
    }

    .harbor-panel--priority {
        grid-row: span 2;
        min-height: 100%;
    }

    .harbor-panel--fleet {
        grid-column: span 2;
    }
}

@media (min-width: 1080px) {
    .building-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 1180px) {
    .inventory-grid-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
    }
}

@media (max-width: 900px) {
    .inventory-slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
    }
}

@media (max-width: 640px) {
    .inventory-grid-stack {
        grid-template-columns: 1fr;
    }

    .inventory-category-panel {
        padding: .7rem;
    }

    .inventory-slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(3.95rem, 1fr));
        gap: .42rem;
    }

    .inventory-slot {
        padding: .48rem .34rem .4rem;
    }

    .inventory-slot strong {
        right: .26rem;
        bottom: .26rem;
        min-width: 1.32rem;
        font-size: .66rem;
    }
}

/* Production Screen */

.nm-production-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.nm-production-sidebar__head {
    padding: .92rem .95rem .82rem;
    border-bottom: 1px solid rgba(252, 226, 159, .28);
    background:
        linear-gradient(90deg, rgba(252, 226, 159, .1), transparent 64%),
        rgba(8, 27, 34, .28);
}

.nm-production-sidebar__head span,
.nm-production-main__eyebrow,
.nm-production-label {
    display: block;
    color: rgba(252, 226, 159, .76);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.nm-production-sidebar__head strong {
    display: block;
    margin-top: .36rem;
    color: #f8f0df;
    font-size: 1.08rem;
    line-height: 1.05;
}

.nm-production-building-list {
    display: grid;
    align-content: start;
    gap: .42rem;
    overflow-y: auto;
    padding: .62rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 226, 159, .32) transparent;
}

.nm-production-building {
    appearance: none;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: 4rem;
    gap: .62rem;
    padding: .52rem .62rem;
    border: 1px solid rgba(252, 226, 159, .18);
    border-radius: 0;
    color: rgba(248, 240, 223, .78);
    background:
        linear-gradient(90deg, rgba(252, 226, 159, .04), rgba(8, 27, 34, .18)),
        rgba(5, 20, 26, .22);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition:
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease,
        transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.nm-production-building::before {
    content: "";
    position: absolute;
    top: .45rem;
    bottom: .45rem;
    left: 0;
    width: 2px;
    opacity: 0;
    background: linear-gradient(180deg, #fce29f, #aa874b);
}

.nm-production-building:hover,
.nm-production-building:focus-visible,
.nm-production-building.is-active {
    color: #fce29f;
    border-color: rgba(252, 226, 159, .5);
    background:
        linear-gradient(90deg, rgba(252, 226, 159, .13), rgba(34, 86, 91, .16)),
        rgba(5, 20, 26, .42);
    outline: none;
}

.nm-production-building:hover,
.nm-production-building:focus-visible {
    transform: translateX(.08rem);
}

.nm-production-building.is-active::before {
    opacity: 1;
}

.nm-production-building img {
    width: 2.34rem;
    height: 2.34rem;
    object-fit: contain;
    filter: drop-shadow(0 .22rem .28rem rgba(4, 17, 22, .34));
}

.nm-production-building__text {
    min-width: 0;
}

.nm-production-building__text strong {
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: .88rem;
    font-weight: 950;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-production-building__text span {
    display: block;
    margin-top: .22rem;
    overflow: hidden;
    color: rgba(248, 240, 223, .58);
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-production-building__count {
    min-width: 2.4rem;
    color: rgba(252, 226, 159, .76);
    font-size: .74rem;
    font-weight: 900;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.nm-production-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.nm-production-main__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.05rem 1.15rem .95rem;
    border-bottom: 1px solid rgba(252, 226, 159, .28);
    background:
        linear-gradient(90deg, rgba(252, 226, 159, .12), transparent 58%),
        rgba(8, 27, 34, .26);
}

.nm-production-main__title {
    min-width: 0;
}

.nm-production-main__title h1 {
    margin: .32rem 0 0;
    color: #fce29f;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    line-height: .98;
    letter-spacing: 0;
}

.nm-production-main__title p {
    max-width: 50rem;
    margin: .52rem 0 0;
    color: rgba(248, 240, 223, .74);
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.42;
}

.nm-production-status {
    display: grid;
    min-width: 10rem;
    padding: .66rem .75rem;
    border-left: 2px solid rgba(252, 226, 159, .54);
    background: rgba(4, 17, 22, .28);
    text-align: right;
}

.nm-production-status strong {
    color: #fce29f;
    font-size: .9rem;
    font-weight: 950;
    line-height: 1;
}

.nm-production-status span {
    margin-top: .26rem;
    color: rgba(248, 240, 223, .62);
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.15;
}

.nm-production-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
    min-height: 0;
    gap: 1rem;
    overflow: auto;
    padding: 1rem;
}

.nm-production-focus,
.nm-production-queue {
    min-width: 0;
    border: 1px solid rgba(252, 226, 159, .24);
    border-radius: 0;
    background:
        linear-gradient(150deg, rgba(8, 27, 34, .58), rgba(14, 40, 48, .42)),
        rgba(6, 21, 27, .32);
    box-shadow: inset 0 1px 0 rgba(252, 226, 159, .08);
}

.nm-production-focus {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    gap: 1.05rem;
    padding: 1rem;
}

.nm-production-product-icon {
    display: grid;
    width: 7rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(252, 226, 159, .34);
    border-radius: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(252, 226, 159, .2), transparent 58%),
        rgba(4, 17, 22, .34);
}

.nm-production-product-icon img {
    width: 5.6rem;
    height: 5.6rem;
    object-fit: contain;
    filter: drop-shadow(0 .34rem .48rem rgba(4, 17, 22, .38));
}

.nm-production-recipe {
    min-width: 0;
}

.nm-production-recipe h2 {
    margin: .28rem 0 0;
    color: #f8f0df;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.nm-production-recipe p {
    margin: .48rem 0 0;
    color: rgba(248, 240, 223, .72);
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.48;
}

.nm-production-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .48rem;
    margin: .95rem 0 0;
}

.nm-production-fact {
    min-width: 0;
    padding: .58rem .62rem;
    border-left: 2px solid rgba(252, 226, 159, .44);
    background: rgba(4, 17, 22, .26);
}

.nm-production-fact span {
    display: block;
    color: rgba(248, 240, 223, .58);
    font-size: .68rem;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.nm-production-fact strong {
    display: block;
    margin-top: .34rem;
    overflow: hidden;
    color: #fce29f;
    font-size: .9rem;
    font-weight: 950;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-production-costs {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
    margin-top: 1rem;
}

.nm-production-cost {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    min-height: 2.3rem;
    gap: .36rem;
    padding: .28rem .52rem .28rem .34rem;
    border: 1px solid rgba(252, 226, 159, .24);
    border-radius: 0;
    background: rgba(4, 17, 22, .28);
    color: rgba(248, 240, 223, .76);
    font-size: .78rem;
    font-weight: 850;
    line-height: 1;
}

.nm-production-cost img {
    width: 1.55rem;
    height: 1.55rem;
    object-fit: contain;
}

.nm-production-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-top: 1.15rem;
}

.nm-production-amount {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(2.55rem, auto));
    border: 1px solid rgba(252, 226, 159, .24);
    border-radius: 0;
    overflow: hidden;
}

.nm-production-amount button,
.nm-production-primary {
    appearance: none;
    min-height: 2.65rem;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 950;
}

.nm-production-amount button {
    color: rgba(248, 240, 223, .74);
    background: rgba(4, 17, 22, .26);
}

.nm-production-amount button + button {
    border-left: 1px solid rgba(252, 226, 159, .18);
}

.nm-production-amount button:hover,
.nm-production-amount button:focus-visible,
.nm-production-amount button.is-active {
    color: #fce29f;
    background: rgba(252, 226, 159, .11);
    outline: none;
}

.nm-production-primary {
    display: inline-grid;
    place-items: center;
    min-width: 12rem;
    padding: 0 .95rem;
    color: #102a30;
    background: linear-gradient(135deg, #fce29f, #aa874b);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .32),
        0 .7rem 1.25rem rgba(4, 17, 22, .28);
}

.nm-production-primary:hover,
.nm-production-primary:focus-visible {
    filter: brightness(1.07);
    outline: 2px solid rgba(252, 226, 159, .54);
    outline-offset: 2px;
}

.nm-production-queue {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.nm-production-queue__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem .88rem;
    border-bottom: 1px solid rgba(252, 226, 159, .22);
    background: rgba(4, 17, 22, .22);
}

.nm-production-queue__head h2 {
    margin: .28rem 0 0;
    color: #f8f0df;
    font-size: 1.02rem;
    line-height: 1;
}

.nm-production-queue__head strong {
    color: #fce29f;
    font-size: .84rem;
    font-weight: 950;
    white-space: nowrap;
}

.nm-production-queue ol {
    display: grid;
    align-content: start;
    gap: .54rem;
    overflow-y: auto;
    margin: 0;
    padding: .72rem;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 226, 159, .32) transparent;
}

.nm-production-job {
    display: grid;
    gap: .42rem;
    padding: .62rem;
    border: 1px solid rgba(252, 226, 159, .18);
    border-radius: 0;
    background: rgba(4, 17, 22, .24);
}

.nm-production-job__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: rgba(248, 240, 223, .78);
    font-size: .82rem;
    font-weight: 850;
    line-height: 1.15;
}

.nm-production-job__time {
    color: #fce29f;
    font-variant-numeric: tabular-nums;
}

.nm-production-job__bar {
    height: .38rem;
    border: 1px solid rgba(252, 226, 159, .18);
    background: rgba(4, 17, 22, .36);
}

.nm-production-job__bar span {
    display: block;
    width: var(--progress, 0%);
    height: 100%;
    background: linear-gradient(90deg, #aa874b, #fce29f);
}

/* Tooltip */

.nm-tooltip {
    position: fixed;
    z-index: var(--nm-z-tooltip);
    width: max-content;
    max-width: min(17rem, calc(100vw - 1.5rem));
    padding: .66rem .78rem .72rem;
    border: 1px solid rgba(252, 226, 159, .58);
    border-radius: .78rem;
    color: rgba(248, 240, 223, .9);
    background:
        linear-gradient(145deg, rgba(34, 86, 91, .96), rgba(14, 40, 48, .98) 64%),
        var(--nm-color-harbor);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .14),
        0 .85rem 1.8rem rgba(4, 17, 22, .42);
    opacity: 0;
    pointer-events: none;
    transform: translateY(.22rem);
    transition:
        opacity 150ms ease,
        transform 150ms ease;
    backdrop-filter: blur(.55rem);
}

.nm-tooltip::after {
    content: "";
    position: absolute;
    left: var(--nm-tooltip-arrow-x, 50%);
    width: .62rem;
    height: .62rem;
    border-left: 1px solid rgba(252, 226, 159, .5);
    border-top: 1px solid rgba(252, 226, 159, .5);
    background: rgba(34, 86, 91, .96);
    transform: translateX(-50%) rotate(45deg);
}

.nm-tooltip[data-placement="bottom"]::after {
    top: -.36rem;
}

.nm-tooltip[data-placement="top"]::after {
    bottom: -.36rem;
    border: 0;
    border-right: 1px solid rgba(252, 226, 159, .5);
    border-bottom: 1px solid rgba(252, 226, 159, .5);
    background: rgba(14, 40, 48, .98);
}

.nm-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.nm-tooltip strong {
    display: block;
    color: #fce29f;
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .03em;
    line-height: 1.1;
    text-transform: uppercase;
}

.nm-tooltip span {
    display: block;
    margin-top: .28rem;
    color: rgba(248, 240, 223, .78);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
}

.resource-tooltip {
    z-index: var(--nm-z-tooltip);
    max-width: min(19rem, calc(100vw - 1rem));
    padding: .66rem .78rem .72rem;
    border: 1px solid rgba(252, 226, 159, .58);
    border-radius: .78rem;
    color: rgba(248, 240, 223, .9);
    background:
        linear-gradient(145deg, rgba(34, 86, 91, .96), rgba(14, 40, 48, .98) 64%),
        var(--nm-color-harbor);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .14),
        0 .85rem 1.8rem rgba(4, 17, 22, .42);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.35;
    backdrop-filter: blur(.55rem);
}

/* Modal */

.nm-modal {
    position: fixed;
    inset: 0;
    z-index: var(--nm-z-modal);
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(4, 17, 22, .48);
    opacity: 0;
    transition: opacity 180ms ease;
    backdrop-filter: blur(.35rem);
}

@keyframes nm-modal-mist-in {
    0% {
        opacity: 0;
        transform: translateY(1.15rem) scale(.965);
        filter: blur(.25rem);
    }

    62% {
        opacity: 1;
        transform: translateY(-.12rem) scale(1.006);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes nm-modal-mist-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: translateY(.85rem) scale(.982);
        filter: blur(.16rem);
    }
}

.nm-modal[hidden] {
    display: none;
}

.nm-modal.is-visible {
    opacity: 1;
}

.nm-modal.is-closing {
    opacity: 0;
    pointer-events: none;
}

.nm-modal__panel {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: min(38rem, 100%);
    gap: 1.16rem;
    overflow: hidden;
    padding: 1.14rem 1.22rem 1.22rem;
    border: 1px solid rgba(252, 226, 159, .62);
    border-radius: 1rem;
    color: rgba(248, 240, 223, .88);
    background:
        radial-gradient(circle at 16% 18%, rgba(252, 226, 159, .15), transparent 34%),
        linear-gradient(145deg, rgba(34, 86, 91, .82), rgba(14, 40, 48, .9) 62%),
        rgba(14, 40, 48, .82);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .14),
        inset 0 -1px 0 rgba(170, 135, 75, .18),
        0 1.4rem 3rem rgba(4, 17, 22, .48);
    opacity: 0;
    transform: translateY(1.15rem) scale(.965);
}

.nm-modal__panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 3.9rem;
    left: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(252, 226, 159, .55), transparent);
    pointer-events: none;
}

.nm-modal.is-visible .nm-modal__panel {
    animation: nm-modal-mist-in 420ms cubic-bezier(.18, .84, .24, 1) both;
}

.nm-modal.is-closing .nm-modal__panel {
    animation: nm-modal-mist-out 260ms ease both;
}

.nm-modal__icon {
    display: grid;
    width: 7.65rem;
    aspect-ratio: 1;
    place-items: center;
    align-self: start;
    border: 1px solid rgba(252, 226, 159, .52);
    border-radius: 1.05rem;
    background:
        radial-gradient(circle at 50% 38%, rgba(252, 226, 159, .28), transparent 61%),
        rgba(8, 27, 34, .46);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .16),
        0 .9rem 1.7rem rgba(4, 17, 22, .3);
}

.nm-modal__icon img {
    width: 6.35rem;
    height: 6.35rem;
    object-fit: contain;
    filter: drop-shadow(0 .3rem .45rem rgba(4, 17, 22, .34));
}

.nm-modal__icon .resource-icon {
    width: 6.35rem;
    height: 6.35rem;
}

.nm-modal__icon .resource-icon img {
    width: 100%;
    height: 100%;
}

.nm-modal__content {
    min-width: 0;
    padding-right: 2.2rem;
}

.nm-modal__content h2 {
    margin: 0;
    color: #fce29f;
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    line-height: 1.05;
    letter-spacing: .01em;
}

.nm-modal__content p {
    margin: .62rem 0 0;
    font-size: .98rem;
    font-weight: 650;
    line-height: 1.48;
}

.nm-modal__facts {
    display: grid;
    grid-template-columns: minmax(7.2rem, .62fr) minmax(0, 1.38fr);
    gap: .58rem;
    margin-top: 1rem;
}

.nm-modal__fact {
    display: grid;
    gap: .25rem;
    min-width: 0;
    padding: .62rem .7rem;
    border: 1px solid rgba(252, 226, 159, .26);
    border-radius: .72rem;
    background:
        linear-gradient(150deg, rgba(8, 27, 34, .48), rgba(14, 40, 48, .28)),
        rgba(4, 17, 22, .24);
    box-shadow: inset 0 1px 0 rgba(252, 226, 159, .08);
}

.nm-modal__fact span {
    color: rgba(252, 226, 159, .72);
    font-size: .68rem;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
}

.nm-modal__fact strong {
    color: rgba(248, 240, 223, .9);
    font-size: .92rem;
    font-weight: 850;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.nm-modal__fact:first-child strong {
    color: var(--nm-color-gold-light);
    font-size: 1.08rem;
}

.nm-modal__close {
    position: absolute;
    top: .68rem;
    right: .68rem;
    display: grid;
    width: 2.18rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(252, 226, 159, .32);
    border-radius: 50%;
    color: #fce29f;
    background:
        radial-gradient(circle at 50% 42%, rgba(252, 226, 159, .11), transparent 62%),
        rgba(8, 27, 34, .54);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .12),
        0 .35rem .8rem rgba(4, 17, 22, .18);
    cursor: pointer;
    padding: 0;
    transition:
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.nm-modal__close img {
    width: 1.08rem;
    height: 1.08rem;
    opacity: .92;
    transition:
        opacity 160ms ease,
        transform 180ms ease;
}

.nm-modal__close:hover,
.nm-modal__close:focus-visible {
    border-color: rgba(252, 226, 159, .72);
    background:
        radial-gradient(circle at 50% 42%, rgba(252, 226, 159, .2), transparent 62%),
        rgba(14, 40, 48, .72);
    box-shadow:
        inset 0 1px 0 rgba(252, 226, 159, .18),
        0 .45rem 1rem rgba(4, 17, 22, .22);
    outline: none;
    transform: translateY(-.04rem);
}

.nm-modal__close:hover img,
.nm-modal__close:focus-visible img {
    opacity: 1;
    transform: rotate(90deg) scale(1.04);
}

/* Responsive */

@media (min-width: 1921px) {
    .nm-topbar {
        width: min(var(--nm-width-page-wide), calc(100% - 4rem));
    }

    .nm-bottom-nav {
        --nm-bottom-width: min(var(--nm-width-page-wide), calc(100% - 4rem));
    }

    .nm-main-layout {
        --nm-content-width: min(var(--nm-width-page-wide), calc(100% - 4rem));
    }
}

@keyframes nm-popover-in {
    from {
        opacity: 0;
        transform: translateY(-.4rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1919px) {
    .nm-topbar__resource-toggle {
        display: inline-flex;
    }

    .nm-topbar__materials {
        position: absolute;
        top: calc(100% + .7rem);
        left: var(--nm-edge-padding);
        z-index: 5;
        display: none;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: min(34rem, calc(100% - (var(--nm-edge-padding) * 2)));
        gap: .38rem;
        overflow: visible;
        padding: .7rem;
        border: 1px solid rgba(252, 226, 159, .48);
        border-radius: .9rem;
        background:
            linear-gradient(145deg, rgba(34, 86, 91, .94), rgba(14, 40, 48, .98)),
            #0e2830;
        box-shadow:
            inset 0 1px 0 rgba(252, 226, 159, .14),
            0 1rem 2.1rem rgba(4, 17, 22, .38);
    }

    .nm-topbar.is-resources-open .nm-topbar__materials {
        display: grid;
        animation: nm-popover-in 180ms ease both;
    }
}

@media (max-width: 1180px) {
    .nm-user-menu__toggle {
        max-width: 8.4rem;
    }

    .nm-main-layout {
        grid-template-columns: minmax(13rem, 15.5rem) minmax(0, 1fr);
        gap: .78rem;
    }

    .nm-production-workbench {
        grid-template-columns: 1fr;
    }

    .nm-production-queue {
        min-height: 14rem;
    }
}

@media (max-width: 900px) {
    .nm-main-layout {
        top: calc(9.85rem + env(safe-area-inset-top));
        bottom: calc(6.75rem + env(safe-area-inset-bottom));
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        overflow-y: auto;
        gap: .62rem;
    }

    .nm-production-sidebar {
        grid-template-rows: auto;
        overflow: visible;
    }

    .nm-production-sidebar__head {
        display: none;
    }

    .nm-production-building-list {
        display: flex;
        gap: .38rem;
        overflow-x: auto;
        padding: .42rem;
    }

    .nm-production-building {
        flex: 0 0 12.5rem;
        min-height: 3.36rem;
    }

    .nm-production-building:hover,
    .nm-production-building:focus-visible {
        transform: translateY(-.04rem);
    }

    .nm-production-building img {
        width: 1.9rem;
        height: 1.9rem;
    }

    .nm-production-main {
        overflow: visible;
    }

    .nm-production-workbench {
        overflow: visible;
        padding: .75rem;
    }

    .nm-bottom-nav {
        --nm-bottom-width: calc(100% - 1rem);
        bottom: calc(14px + env(safe-area-inset-bottom));
        min-height: 4.12rem;
        gap: .18rem;
        padding: .34rem;
        border-radius: .9rem;
    }

    .nm-bottom-nav__link {
        min-height: 3.28rem;
        gap: .12rem;
        padding: .22rem .18rem;
        border-radius: .68rem;
        font-size: .68rem;
    }

    .nm-bottom-nav__link img {
        width: 1.96rem;
        height: 1.96rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nm-bg__slide {
        animation: none;
        transition: none;
        transform: none;
    }

    .nm-logo,
    .nm-logo img,
    .nm-logo::before,
    .nm-tooltip,
    .nm-modal,
    .nm-modal__panel,
    .nm-modal__close,
    .nm-modal__close img,
    .nm-bottom-nav__link,
    .nm-bottom-nav__link img {
        animation: none !important;
        transition: none;
    }

    .nm-topbar.is-resources-open .nm-topbar__materials {
        animation: none;
    }

    .nm-user-menu.is-open .nm-user-menu__dropdown {
        animation: none;
    }

    .nm-bg__slide:not(:first-child) {
        display: none;
    }

    .nm-bg__slide:first-child {
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .nm-main-layout {
        --nm-content-width: calc(100% - 1rem);
        top: calc(8.4rem + env(safe-area-inset-top));
        bottom: calc(5rem + env(safe-area-inset-bottom));
        gap: .5rem;
    }

    .nm-panel {
        border-radius: .78rem;
    }

    .nm-topbar {
        --nm-edge-padding: 12px;
        --nm-logo-size: clamp(5.4rem, 26vw, 7.2rem);
        top: calc(42px + env(safe-area-inset-top));
        width: min(calc(100% - 1rem), 1440px);
        min-height: 3rem;
        padding-inline: 0;
    }

    .nm-topbar__materials {
        left: var(--nm-edge-padding);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: calc(100% - (var(--nm-edge-padding) * 2));
        max-height: calc(100vh - 10rem);
        gap: .32rem;
        overflow-y: auto;
        padding: .58rem;
    }

    .nm-topbar__resource-toggle {
        min-width: 2.35rem;
        justify-content: center;
        padding-inline: .6rem;
    }

    .nm-topbar__resource-toggle span {
        display: none;
    }

    .nm-topbar__material {
        min-width: 2.52rem;
        min-height: 1.92rem;
        gap: .06rem;
        padding: .15rem .22rem .15rem .14rem;
    }

    .nm-topbar__material img {
        width: 1.48rem;
        height: 1.48rem;
    }

    .nm-topbar__material strong {
        font-size: .7rem;
    }

    .nm-topbar__account {
        gap: .18rem;
        padding-left: calc((var(--nm-logo-size) / 2) + .35rem);
        padding-right: var(--nm-edge-padding);
    }

    .nm-topbar__currencies {
        gap: .18rem;
    }

    .nm-topbar__materials .resource-icon,
    .nm-topbar__currencies .resource-icon {
        width: 1.46rem;
        height: 1.46rem;
    }

    .nm-currency {
        min-height: 2rem;
        padding: .14rem .22rem;
    }

    .nm-currency img {
        width: 1.46rem;
        height: 1.46rem;
    }

    .nm-currency strong {
        display: none;
    }

    .nm-user-menu__toggle {
        display: grid;
        grid-template-columns: 1fr;
        min-width: 2rem;
        min-height: 2rem;
        padding: .18rem;
    }

    .nm-user-menu__toggle > img:first-child {
        width: 1.48rem;
        height: 1.48rem;
        padding: .16rem;
    }

    .nm-user-menu__toggle span,
    .nm-user-menu__toggle > img:last-child {
        display: none;
    }

    .nm-user-menu__dropdown {
        right: 0;
        width: min(15rem, calc(100vw - 1rem));
    }

    .nm-production-building-list {
        padding: .34rem;
    }

    .nm-production-building {
        flex-basis: 10.7rem;
        min-height: 3.04rem;
        gap: .46rem;
        padding: .42rem .5rem;
    }

    .nm-production-building__text strong {
        font-size: .8rem;
    }

    .nm-production-building__text span,
    .nm-production-building__count {
        font-size: .66rem;
    }

    .nm-production-building img {
        width: 1.66rem;
        height: 1.66rem;
    }

    .nm-production-main__head {
        grid-template-columns: 1fr;
        align-items: start;
        gap: .7rem;
        padding: .82rem .82rem .74rem;
    }

    .nm-production-main__title h1 {
        font-size: 1.55rem;
    }

    .nm-production-main__title p {
        font-size: .82rem;
    }

    .nm-production-status {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .nm-production-workbench {
        gap: .62rem;
        padding: .58rem;
    }

    .nm-production-focus {
        grid-template-columns: 1fr;
        gap: .78rem;
        padding: .75rem;
    }

    .nm-production-product-icon {
        width: 5.4rem;
    }

    .nm-production-product-icon img {
        width: 4.35rem;
        height: 4.35rem;
    }

    .nm-production-facts {
        grid-template-columns: 1fr;
        gap: .36rem;
    }

    .nm-production-primary {
        width: 100%;
    }

    .nm-game-panel {
        padding: .7rem;
    }

    .nm-bottom-nav {
        --nm-bottom-width: calc(100% - 1rem);
        bottom: calc(10px + env(safe-area-inset-bottom));
        grid-template-columns: repeat(7, minmax(0, 1fr));
        min-height: 3.32rem;
        gap: .08rem;
        overflow: hidden;
        padding: .28rem;
    }

    .nm-bottom-nav__link {
        grid-template-rows: 1fr;
        min-height: 2.72rem;
        padding: .18rem .1rem;
        border-radius: .58rem;
    }

    .nm-bottom-nav__link img {
        width: 1.76rem;
        height: 1.76rem;
    }

    .nm-bottom-nav__link span {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .nm-modal__panel {
        grid-template-columns: 1fr;
        gap: .8rem;
        padding: .9rem;
    }

    .nm-modal__icon {
        width: 6.2rem;
    }

    .nm-modal__icon img,
    .nm-modal__icon .resource-icon {
        width: 5.15rem;
        height: 5.15rem;
    }

    .nm-modal__content {
        padding-right: 0;
    }

    .nm-modal__facts {
        grid-template-columns: 1fr;
        gap: .45rem;
    }
}

@media (max-width: 480px) {
    .nm-main-layout {
        --nm-content-width: calc(100% - .5rem);
        top: calc(8.05rem + env(safe-area-inset-top));
        bottom: calc(4.28rem + env(safe-area-inset-bottom));
    }

    .nm-production-building {
        flex-basis: 9.4rem;
    }

    .nm-production-building__count {
        display: none;
    }

    .nm-production-recipe h2 {
        font-size: 1.32rem;
    }

    .nm-production-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .nm-production-amount {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .nm-game-panel {
        padding: .5rem;
    }

    .nm-bottom-nav {
        --nm-bottom-width: calc(100% - .5rem);
        bottom: calc(6px + env(safe-area-inset-bottom));
        min-height: 3.05rem;
        gap: .04rem;
        padding: .22rem;
        border-radius: .78rem;
    }

    .nm-bottom-nav__link {
        min-height: 2.48rem;
        padding-inline: .04rem;
        border-radius: .48rem;
    }

    .nm-bottom-nav__link::before {
        inset: .12rem;
        border-radius: .42rem;
    }

    .nm-bottom-nav__link img {
        width: 1.55rem;
        height: 1.55rem;
    }
}
