
        @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

        :root {
            color-scheme: dark;
            --bg: #111512;
            --panel: #1b201c;
            --line: #323a32;
            --muted: #939e91;
            --text: #edf0e7;
            --lime: #d3ed91
        }

        * {
            box-sizing: border-box
        }

        body {
            margin: 0;
            background: var(--bg);
            color: var(--text);
            font: 15px 'DM Sans', sans-serif
        }

        button,
        input,
        select {
            font: inherit
        }

        button {
            cursor: pointer
        }

        button:focus-visible,
        input:focus-visible,
        select:focus-visible {
            outline: 2px solid var(--lime);
            outline-offset: 4px
        }

        button {
            color: inherit
        }

        header {
            height: 90px;
            border-bottom: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 6%
        }

        .brand {
            font: 700 22px 'Space Grotesk', sans-serif;
            display: flex;
            align-items: center;
            gap: 12px
        }

        .brand-icon {
            background: var(--lime);
            color: #26311b;
            padding: 8px 12px;
            border-radius: 9px
        }

        header small {
            color: var(--muted)
        }

        main {
            max-width: 1280px;
            margin: 48px auto;
            padding: 0 32px
        }

        .eyebrow {
            color: var(--lime);
            font-size: 11px;
            letter-spacing: 2px;
            font-weight: 700
        }

        h1 {
            font: 500 clamp(30px, 4vw, 46px) 'Space Grotesk', sans-serif;
            letter-spacing: -1.8px;
            margin: 12px 0
        }

        p {
            color: var(--muted);
            line-height: 1.6
        }

        .layout {
            display: grid;
            grid-template-columns: 1.06fr 1fr;
            gap: 24px;
            margin-top: 34px
        }

        .panel {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 16px;
            padding: 26px
        }

        .section-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px
        }

        h2 {
            font: 500 19px 'Space Grotesk', sans-serif;
            margin: 0
        }

        .number {
            font-size: 12px;
            border: 1px solid #48523f;
            color: var(--lime);
            border-radius: 50%;
            width: 25px;
            height: 25px;
            display: grid;
            place-items: center
        }

        .label {
            display: block;
            color: var(--muted);
            font-size: 12px;
            margin: 20px 0 10px
        }

        .materials-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
            gap: 7px
        }

        .material-option {
            position: relative;
            aspect-ratio: 1;
            min-width: 0;
            display: grid;
            place-items: center;
            padding: 3px;
            border: 1px solid var(--line);
            border-top: 3px solid var(--material-color);
            border-radius: 7px;
            background: #232a24;
            color: var(--material-color);
            cursor: pointer;
            transition: border-color .15s, background .15s, transform .15s
        }

        .material-option[data-tooltip]::before,
        .material-option[data-tooltip]::after,
        .item[data-tooltip]::before,
        .item[data-tooltip]::after {
            position: absolute;
            z-index: 20;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity .06s ease, transform .06s ease
        }

        .material-option[data-tooltip]::before,
        .item[data-tooltip]::before {
            content: '';
            top: calc(100% + 4px);
            left: 50%;
            width: 8px;
            height: 8px;
            border-top: 1px solid var(--material-color, var(--lime));
            border-left: 1px solid var(--material-color, var(--lime));
            background: #101410;
            transform: translate(-50%, -2px) rotate(45deg)
        }

        .material-option[data-tooltip]::after,
        .item[data-tooltip]::after {
            content: attr(data-tooltip);
            top: calc(100% + 8px);
            left: 50%;
            width: max-content;
            max-width: min(220px, calc(100vw - 24px));
            padding: 8px 11px;
            border: 1px solid var(--material-color, var(--lime));
            border-radius: 6px;
            background: #101410;
            box-shadow: 0 6px 18px #0009;
            color: #f0f3e8;
            font: 600 12px 'DM Sans', sans-serif;
            line-height: 1.2;
            white-space: normal;
            text-align: center;
            transform: translate(-50%, -2px)
        }

        .material-option:hover,
        .material-option:focus-visible,
        .item:hover,
        .item:focus-visible {
            z-index: 5
        }

        .material-option:hover::before,
        .material-option:hover::after,
        .material-option:focus-visible::before,
        .material-option:focus-visible::after,
        .item:hover::before,
        .item:hover::after,
        .item:focus-visible::before,
        .item:focus-visible::after {
            opacity: 1;
            visibility: visible
        }

        .material-option:hover::before,
        .material-option:focus-visible::before,
        .item:hover::before,
        .item:focus-visible::before {
            transform: translate(-50%, 0) rotate(45deg)
        }

        .material-option:hover::after,
        .material-option:focus-visible::after,
        .item:hover::after,
        .item:focus-visible::after {
            transform: translate(-50%, 0)
        }

        .material-option:first-child::after {
            left: 0;
            transform: translateY(-2px)
        }

        .material-option:first-child:hover::after,
        .material-option:first-child:focus-visible::after {
            transform: translateY(0)
        }

        .material-option:last-child::after {
            right: 0;
            left: auto;
            transform: translateY(-2px)
        }

        .material-option:last-child:hover::after,
        .material-option:last-child:focus-visible::after {
            transform: translateY(0)
        }

        .item:first-child::after {
            left: 0;
            transform: translateY(-2px)
        }

        .item:first-child:hover::after,
        .item:first-child:focus-visible::after {
            transform: translateY(0)
        }

        .item:last-child::after {
            right: 0;
            left: auto;
            transform: translateY(-2px)
        }

        .item:last-child:hover::after,
        .item:last-child:focus-visible::after {
            transform: translateY(0)
        }

        .material-option:hover {
            border-color: var(--material-color);
            background: #2e382b;
            transform: translateY(-1px)
        }

        .material-option.selected {
            border-color: var(--lime);
            border-top-color: var(--material-color);
            background: #323d27;
            box-shadow: inset 0 0 0 1px var(--lime)
        }

        .material-mark {
            font: 600 11px 'Space Grotesk', sans-serif;
            line-height: 1
        }

        .material-mark img {
            display: block;
            width: 30px;
            height: 30px;
            object-fit: contain;
            image-rendering: pixelated
        }

        .items {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px
        }

        .item,
        .action {
            background: #232a24;
            border: 1px solid var(--line);
            border-radius: 9px;
            padding: 13px 4px;
            transition: .15s
        }

        .item:hover,
        .action:hover {
            border-color: var(--action-color, #809164);
            background: #2e382b
        }

        .item.selected,
        .action.selected {
            border-color: var(--lime);
            background: #323d27
        }

        .icon {
            display: block;
            font-size: 27px;
            height: 36px;
            line-height: 36px;
            image-rendering: pixelated
        }

        .icon img {
            width: 32px;
            height: 32px;
            object-fit: contain;
            image-rendering: pixelated
        }

        .any-hit-glyph {
            display: inline-flex;
            height: 26px;
            align-items: center;
            justify-content: center;
            vertical-align: top
        }

        .any-hit-glyph img {
            width: 11px;
            height: 26px;
            margin: 0 -1px;
            object-fit: contain
        }

        .item small,
        .action small {
            display: block;
            font-size: 10px;
            margin-top: 6px;
            color: #c0c8ba
        }

        .target-row {
            display: flex;
            align-items: center;
            gap: 15px;
            background: #141a15;
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 12px 16px
        }

        .target-row input {
            width: 100%;
            min-width: 0;
            background: none;
            border: 0;
            color: var(--text);
            font: 500 29px 'Space Grotesk', sans-serif;
            outline: none
        }

        .target-row span {
            color: var(--muted);
            font-size: 12px;
            white-space: nowrap
        }

        .divider {
            height: 1px;
            background: var(--line);
            margin: 26px 0
        }

        .slots {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 9px
        }

        .slot {
            border: 1px dashed #505d48;
            background: #161c17;
            border-radius: 10px;
            min-height: 95px;
            color: var(--muted);
            padding: 10px
        }

        .slot.active {
            border: 1px solid var(--lime);
            background: #2c3525
        }

        .slot .icon {
            font-size: 23px
        }

        .slot small {
            display: block;
            font-size: 11px;
            margin-top: 5px
        }

        .actions {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px
        }

        .action {
            padding: 9px 3px
        }

        .action .icon {
            font-size: 21px;
            height: 28px;
            line-height: 28px
        }

        .action .icon img {
            width: 26px;
            height: 26px
        }

        .action .icon .any-hit-glyph img {
            width: 8px;
            height: 24px
        }

        .action .icon,
        .action .value {
            color: var(--action-color, var(--lime))
        }

        .value {
            font-size: 11px;
            color: var(--lime);
            display: block;
            margin-top: 6px
        }

        .hint {
            font-size: 11px;
            color: var(--muted);
            line-height: 1.6
        }

        .primary {
            width: 100%;
            border: 0;
            background: var(--lime);
            color: #1c2815;
            border-radius: 9px;
            padding: 16px;
            font-weight: 700;
            margin-top: 22px
        }

        .primary:hover {
            background: #e1f7af
        }

        .result-panel {
            display: flex;
            flex-direction: column;
            min-height: 510px
        }

        .pill {
            margin-left: auto;
            font-size: 10px;
            color: var(--lime);
            background: #303b25;
            border-radius: 20px;
            padding: 6px 10px
        }

        .result-head {
            display: flex;
            align-items: center;
            gap: 16px;
            margin: 9px 0 20px
        }

        .result-icon {
            font-size: 36px;
            background: #2b3327;
            border: 1px solid #46523b;
            border-radius: 12px;
            padding: 14px
        }

        .result-head h3 {
            font: 500 24px 'Space Grotesk', sans-serif;
            margin: 0 0 5px
        }

        .result-head p {
            margin: 0;
            font-size: 12px
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            border: 1px solid var(--line);
            border-radius: 10px;
            margin-bottom: 22px
        }

        .stat {
            padding: 15px;
            text-align: center
        }

        .stat+.stat {
            border-left: 1px solid var(--line)
        }

        .stat strong {
            font: 500 26px 'Space Grotesk', sans-serif;
            display: block
        }

        .stat small {
            color: var(--muted);
            font-size: 10px
        }

        .steps {
            display: flex;
            flex-wrap: wrap;
            gap: 8px
        }

        .step {
            position: relative;
            min-width: 66px;
            text-align: center;
            background: #262e26;
            border: 1px solid #3b4636;
            border-radius: 9px;
            padding: 12px 8px
        }

        .step.finishing {
            border-color: #8a9e64;
            background: #303a27
        }

        .step b {
            font-size: 9px;
            color: var(--muted);
            position: absolute;
            top: 5px;
            left: 6px
        }

        .step .icon {
            font-size: 22px;
            color: var(--action-color, var(--lime))
        }

        .step small {
            font-size: 9px;
            display: block
        }

        .step em {
            font-size: 10px;
            color: var(--action-color, var(--lime));
            font-style: normal
        }

        .legend {
            font-size: 11px;
            color: var(--muted);
            margin: 16px 0
        }

        .save {
            margin-top: auto;
            padding-top: 25px
        }

        .secondary {
            border: 1px solid #535f46;
            background: transparent;
            border-radius: 9px;
            padding: 12px 16px;
            width: 100%;
            color: var(--lime)
        }

        .saved {
            margin-top: 32px
        }

        .saved-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 15px
        }

        .saved-header span {
            color: var(--muted);
            font-size: 12px
        }

        .saved-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px
        }

        .saved-card {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 11px;
            padding: 16px
        }

        .saved-card .load {
            border: 0;
            background: none;
            text-align: left;
            flex: 1
        }

        .saved-card strong {
            display: block;
            margin-bottom: 5px
        }

        .saved-card small {
            color: var(--muted);
            font-size: 11px
        }

        .delete {
            border: 0;
            background: none;
            color: var(--muted);
            font-size: 20px
        }

        .empty {
            color: var(--muted);
            font-size: 13px;
            border: 1px dashed var(--line);
            border-radius: 10px;
            padding: 22px;
            grid-column: 1/-1
        }

        footer {
            display: flex;
            justify-content: space-between;
            color: #73806f;
            font-size: 11px;
            margin: 34px 0
        }

        .error {
            color: #ffb7a7
        }

        button:disabled {
            opacity: .5;
            cursor: default
        }

        @media(max-width:900px) {
            .layout {
                grid-template-columns: 1fr
            }

            .saved-grid {
                grid-template-columns: 1fr 1fr
            }

            header {
                padding: 0 24px
            }
        }

        @media(max-width:520px) {
            main {
                padding: 0 16px;
                margin-top: 30px
            }

            .panel {
                padding: 18px
            }

            .items {
                grid-template-columns: repeat(3, 1fr)
            }

            .saved-grid {
                grid-template-columns: 1fr
            }

            header small {
                display: none
            }

            footer {
                gap: 20px
            }

        }

        .layout {
            grid-template-columns: minmax(0, 860px);
            justify-content: center
        }

        .selection-panel,
        .result-panel {
            min-height: 0
        }

        .materials-grid {
            grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
            gap: 7px
        }

        .material-option {
            display: grid;
            place-items: center;
            min-width: 0;
            min-height: 0;
            aspect-ratio: 1;
            padding: 3px
        }

        .material-mark {
            font: 600 11px 'Space Grotesk', sans-serif;
            line-height: 1
        }

        .items {
            grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
            gap: 7px
        }

        .item {
            position: relative;
            display: grid;
            place-items: center;
            min-width: 0;
            min-height: 0;
            aspect-ratio: 1;
            padding: 3px
        }

        .object-mark {
            font: 600 11px 'Space Grotesk', sans-serif;
            line-height: 1
        }

        .object-mark img {
            display: block;
            width: 32px;
            height: 32px;
            object-fit: contain;
            image-rendering: pixelated
        }

        .light-icon-background {
            display: grid;
            place-items: center;
            width: 36px;
            height: 36px;
            max-width: 100%;
            border-radius: 5px;
            background: #d5d8cf;
            color: #283126
        }

        .section-title .pill {
            margin-left: auto
        }

        .recipe-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin: 8px 0 16px
        }

        .recipe-title {
            min-width: 0
        }

        .recipe-heading h3 {
            margin: 0 0 4px;
            font: 500 22px 'Space Grotesk', sans-serif
        }

        .recipe-heading p {
            margin: 0;
            font-size: 12px
        }

        .recipe-stats {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 5px 12px;
            color: var(--muted);
            text-align: right
        }

        .recipe-stats small {
            color: var(--muted);
            font-size: 9px
        }

        .recipe-stats span {
            white-space: nowrap;
            font-size: 10px
        }

        .recipe-stats strong {
            color: var(--text);
            font: 600 11px 'DM Sans', sans-serif
        }

        .recipe-sequence-scroll {
            width: 100%;
            padding: 3px 2px 8px
        }

        .recipe-steps {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: 10px 24px;
            width: 100%;
            padding: 0;
            margin: 0;
            list-style: none;
            counter-reset: recipe-step
        }

        .recipe-step {
            position: relative;
            display: flex;
            flex: 0 0 76px;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            min-height: 92px;
            padding: 10px 5px 7px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: #161c17;
            text-align: center
        }

        .recipe-step:not(:last-child)::after {
            content: '→';
            position: absolute;
            left: calc(100% + 6px);
            top: 50%;
            color: var(--muted);
            font-size: 16px;
            transform: translateY(-50%)
        }

        .recipe-step.final-action {
            border-color: #8a9e64;
            background: #303a27
        }

        .step-number {
            display: grid;
            place-items: center;
            position: absolute;
            top: 4px;
            left: 5px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #273026;
            color: var(--muted);
            font-size: 9px
        }

        .step-icon {
            width: 38px;
            height: 38px;
            object-fit: contain;
            image-rendering: pixelated
        }

        .step-name {
            font-size: 10px;
            line-height: 1.15
        }

        .step-tag {
            color: var(--lime);
            font-size: 8px;
            font-weight: 700;
            letter-spacing: .5px
        }

        .legend {
            margin-bottom: 0
        }

        @media(max-width:520px) {
            .materials-grid {
                grid-template-columns: repeat(auto-fill, minmax(42px, 1fr))
            }

            .items {
                grid-template-columns: repeat(auto-fill, minmax(42px, 1fr))
            }

            .recipe-heading h3 {
                font-size: 19px
            }

            .recipe-heading {
                align-items: flex-start
            }

            .recipe-stats {
                gap: 4px 8px
            }

            .recipe-stats span {
                font-size: 9px
            }
        }
    
/* World settings */
.seed-panel { margin: 24px 0; padding: 22px; }
.seed-panel label { display: block; font-weight: 600; margin-bottom: 10px; }
.seed-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.seed-controls input { flex: 1; min-width: 220px; padding: 12px; border: 1px solid var(--border, #3a3a3a); border-radius: 8px; background: var(--bg, #171717); color: inherit; font: inherit; }
.seed-controls button { padding: 12px 20px; border-radius: 8px; border: 1px solid var(--line); background: var(--lime); color: #26311b; cursor: pointer; font: inherit; }
.seed-controls input:focus-visible, .seed-controls button:focus-visible { outline: 2px solid #d9a35e; outline-offset: 3px; }
