.h2l-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 36px 16px 72px;
    color: #e5edf6;
}

.h2l-page * {
    box-sizing: border-box;
}

.h2l-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.h2l-hero__copy,
.h2l-hero__preview,
.h2l-panel,
.h2l-board-wrap {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(8, 13, 25, 0.88);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.h2l-hero__copy {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(11, 18, 32, 0.96), rgba(18, 27, 34, 0.9)),
        radial-gradient(circle at 18% 18%, rgba(52, 211, 153, 0.22), transparent 34%),
        radial-gradient(circle at 82% 12%, rgba(250, 204, 21, 0.17), transparent 30%);
}

.h2l-hero__copy::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: 18px;
    width: 180px;
    height: 180px;
    background: url('/assets/images/encyclopedia/blocks/crafting-table.png') center / contain no-repeat;
    image-rendering: pixelated;
    opacity: 0.09;
    transform: rotate(-10deg);
    pointer-events: none;
}

.h2l-back,
.h2l-eyebrow,
.h2l-button,
.h2l-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.h2l-back {
    min-height: 34px;
    color: #9fd9c2;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.h2l-back:hover {
    color: #ffffff;
}

.h2l-eyebrow {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.62);
    color: #bbf7d0;
    font-size: 13px;
    font-weight: 900;
}

.h2l-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 840px;
    margin: 20px 0 0;
    color: #f8fafc;
    font-size: clamp(34px, 5.2vw, 62px);
    font-weight: 950;
    line-height: 1.04;
    letter-spacing: 0;
}

.h2l-hero p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 18px 0 0;
    color: #b8c7d9;
    font-size: 17px;
    line-height: 1.78;
}

.h2l-hero__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.h2l-hero__preview {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: hidden;
    min-height: 300px;
    padding: 24px;
    background:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        rgba(7, 13, 23, 0.92);
    background-size: 24px 24px;
}

.h2l-hero__preview img {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.055);
    image-rendering: pixelated;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.34));
}

.h2l-workbench {
    display: grid;
    grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.h2l-panel {
    padding: 18px;
}

.h2l-panel--controls {
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 108px);
    overflow: auto;
}

.h2l-panel__head,
.h2l-level-editor__head,
.h2l-pool__head,
.h2l-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.h2l-panel__head h2,
.h2l-level-editor h3,
.h2l-manual h3,
.h2l-site-library__head h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 20px;
    font-weight: 950;
}

.h2l-panel__head span,
.h2l-pool__head span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.h2l-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.h2l-tabs button {
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.052);
    color: #b8c7d9;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.h2l-tabs button.is-active {
    border-color: rgba(52, 211, 153, 0.38);
    background: rgba(52, 211, 153, 0.14);
    color: #d1fae5;
}

.h2l-tab-panel {
    display: none;
}

.h2l-tab-panel.is-active {
    display: block;
}

.h2l-search,
.h2l-manual {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.h2l-tab-panel[data-library-panel="site"].is-active {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.h2l-site-library__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
    align-items: center;
}

.h2l-page label {
    display: grid;
    gap: 7px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
}

.h2l-page input,
.h2l-page select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.62);
    color: #f8fafc;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 750;
    outline: none;
}

.h2l-page input:focus,
.h2l-page select:focus {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.h2l-button,
.h2l-icon-button {
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbeafe;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.h2l-button:hover,
.h2l-icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.45);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.h2l-button--primary {
    border-color: rgba(52, 211, 153, 0.38);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(14, 165, 233, 0.18));
    color: #d1fae5;
}

.h2l-icon-button--primary {
    border-color: rgba(52, 211, 153, 0.38);
    background: rgba(52, 211, 153, 0.14);
    color: #d1fae5;
}

.h2l-icon-button {
    width: 42px;
    padding: 0;
}

.h2l-search__button {
    width: 100%;
}

.h2l-status {
    min-height: 22px;
    margin-top: 10px;
    color: #a7f3d0;
    font-size: 13px;
    font-weight: 800;
}

.h2l-status[data-tone="error"] {
    color: #fecaca;
}

.h2l-results,
.h2l-pool__grid,
.h2l-level__items {
    display: grid;
    gap: 10px;
}

.h2l-results {
    margin-top: 12px;
}

.h2l-result {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 74px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.052);
    padding: 10px;
}

.h2l-result img {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.9);
}

.h2l-result strong {
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h2l-result span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #9fb1c5;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h2l-result button {
    margin-top: 8px;
    min-height: 30px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 6px;
    background: rgba(52, 211, 153, 0.1);
    color: #bbf7d0;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.h2l-divider {
    height: 1px;
    margin: 18px 0;
    background: rgba(148, 163, 184, 0.14);
}

.h2l-level-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.h2l-level-editor--below {
    margin-top: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.38);
    padding: 14px;
}

.h2l-level-config {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: center;
}

.h2l-level-config input[type="color"] {
    height: 42px;
    padding: 4px;
}

.h2l-board-wrap {
    min-width: 0;
    padding: 18px;
}

.h2l-toolbar {
    margin-bottom: 14px;
}

.h2l-toolbar label:first-child {
    flex: 1;
}

.h2l-toolbar label:nth-child(2) {
    width: 150px;
}

.h2l-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: end;
    gap: 8px;
}

.h2l-focus-exit {
    display: none;
}

.h2l-board {
    min-height: 700px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 18px;
    background:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    background-size: 24px 24px, 24px 24px, auto;
}

.h2l-canvas {
    position: relative;
    min-height: 0;
}

.h2l-board__spotlight {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 50%;
    width: min(34vw, 360px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.h2l-board__spotlight-frame {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    padding: 14px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(3px);
    cursor: grab;
}

.h2l-board__spotlight-frame img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.h2l-board__title {
    min-height: 56px;
    margin-bottom: 14px;
    color: #ffffff;
    font-size: clamp(24px, 3.4vw, 42px);
    font-weight: 950;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.h2l-levels {
    display: grid;
    gap: 10px;
}

.h2l-level {
    display: grid;
    grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
    min-height: 100px;
    border: 1px solid #000000;
    border-radius: 0;
    overflow: hidden;
    background: #1a1a1a;
}

.h2l-level__label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #000000;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
}

.h2l-level__items {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 8px;
    padding: 8px;
    min-height: 100px;
}

.h2l-level.is-over .h2l-level__items,
.h2l-pool.is-over {
    outline: 2px solid rgba(52, 211, 153, 0.72);
    outline-offset: -4px;
}

.h2l-card {
    display: block;
    width: 84px;
    height: 84px;
    min-height: 84px;
    border: 0;
    border-radius: 4px;
    background: #333333;
    padding: 0;
    overflow: hidden;
    cursor: grab;
}

.h2l-card--pending {
    display: grid;
    grid-template-rows: 84px 38px;
    gap: 8px;
    align-items: start;
    width: 100px;
    height: auto;
    min-height: 0;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    padding: 8px;
}

.h2l-card--pending strong {
    overflow: hidden;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.28;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.h2l-card:active {
    cursor: grabbing;
}

.h2l-card img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.h2l-card--pending img {
    width: 84px;
    height: 84px;
    aspect-ratio: 1;
    justify-self: center;
    border-radius: 6px;
}

.h2l-result--pixel img,
.h2l-card--pixel img,
.h2l-board__spotlight-frame--pixel img {
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

.h2l-pool {
    margin-top: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    padding: 14px;
    background: rgba(2, 6, 23, 0.38);
}

.h2l-pool__body {
    display: grid;
    grid-template-columns: repeat(8, 100px);
    gap: 8px;
    justify-content: start;
}

.h2l-pool__head {
    align-items: flex-start;
    margin-bottom: 12px;
}

.h2l-pool__head strong {
    color: #f8fafc;
    font-size: 16px;
}

.h2l-pool__grid {
    display: contents;
}

.h2l-spotlight-slot {
    min-width: 0;
    min-height: 0;
    border: 1px dashed rgba(52, 211, 153, 0.42);
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.08);
    overflow: hidden;
}

.h2l-spotlight-slot.is-over {
    outline: 2px solid rgba(52, 211, 153, 0.78);
    outline-offset: 2px;
}

.h2l-spotlight-slot__empty {
    display: flex;
    width: 100px;
    min-height: 146px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #bbf7d0;
    text-align: center;
}

.h2l-spotlight-slot__empty strong {
    font-size: 13px;
    font-weight: 950;
}

.h2l-spotlight-slot__empty span {
    color: #8fb9aa;
    font-size: 12px;
    font-weight: 800;
}

.h2l-spotlight-slot__filled .h2l-card--pending {
    width: 100%;
    border: 0;
    background: rgba(52, 211, 153, 0.1);
}

.h2l-focus-lock {
    overflow: hidden;
}

.h2l-page.is-focus-mode {
    max-width: none;
    padding: 0;
}

.h2l-page.is-focus-mode .h2l-hero,
.h2l-page.is-focus-mode .h2l-panel--controls,
.h2l-page.is-focus-mode .h2l-toolbar,
.h2l-page.is-focus-mode .h2l-level-editor {
    display: none;
}

.h2l-page.is-focus-mode .h2l-workbench {
    display: block;
}

.h2l-page.is-focus-mode .h2l-board-wrap {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: flex;
    min-height: 100vh;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: #050816;
}

.h2l-page.is-focus-mode .h2l-focus-exit {
    position: fixed;
    z-index: 10000;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.72);
    color: #e5edf6;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.h2l-page.is-focus-mode .h2l-board {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 18px;
}

.h2l-page.is-focus-mode .h2l-canvas {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.h2l-page.is-focus-mode .h2l-levels {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-rows: repeat(var(--h2l-level-count, 5), minmax(0, 1fr));
}

.h2l-page.is-focus-mode .h2l-level,
.h2l-page.is-focus-mode .h2l-level__items {
    min-height: 0;
}

.h2l-page.is-focus-mode .h2l-pool {
    flex: 0 0 auto;
    max-height: 31vh;
    overflow: auto;
}

@media (max-width: 1120px) {
    .h2l-hero,
    .h2l-workbench {
        grid-template-columns: 1fr;
    }

    .h2l-panel--controls {
        position: static;
        max-height: none;
    }

    .h2l-hero__preview {
        min-height: 220px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .h2l-page {
        padding: 24px 12px 56px;
    }

    .h2l-hero__copy,
    .h2l-board-wrap,
    .h2l-panel {
        padding: 14px;
    }

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

    .h2l-toolbar {
        display: grid;
    }

    .h2l-toolbar label:nth-child(2) {
        width: 100%;
    }

    .h2l-toolbar-actions {
        justify-content: start;
    }

    .h2l-level {
        grid-template-columns: 1fr;
    }

    .h2l-level__label {
        min-height: 54px;
        font-size: 20px;
    }

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

    .h2l-card--pending {
        width: 100%;
    }
}
