:root {
    --font-ui: "Inter", "Segoe UI", sans-serif;
    --font-pixel: "Silkscreen", "Courier New", monospace;
    --radius: 14px;
    --radius-sm: 10px;
    --bg: #1a212a;
    --bg-pattern: #8b93a0;
    --panel: #1f2731;
    --panel-soft: #252f3b;
    --surface-elevated: linear-gradient(170deg, #2a3441 0%, #1f2731 80%);
    --surface-main: linear-gradient(180deg, #1f2833 0%, #1a222c 100%);
    --surface-card: linear-gradient(160deg, #2d3847 0%, #24303d 100%);
    --text: #f4f6fb;
    --muted: #bcc5d1;
    --line: #3e4b5a;
    --accent: #6aa6ff;
    --ok: #22b53f;
    --warn: #64502b;
    --danger: #6d2b31;
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.22);
    --shadow-strong: 0 14px 30px rgba(0, 0, 0, 0.32);
    --theme-toggle-track: linear-gradient(180deg, #3f536c 0%, #2c3d53 100%);
    --theme-toggle-track-border: #627993;
    --theme-toggle-thumb: #eef4ff;
}

html[data-theme="light"] {
    --bg: #ecf2f8;
    --panel: #ffffff;
    --panel-soft: #f7fafd;
    --surface-elevated: linear-gradient(170deg, #ffffff 0%, #f2f7fc 80%);
    --surface-main: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
    --surface-card: linear-gradient(160deg, #ffffff 0%, #edf3fb 100%);
    --text: #1b2a3a;
    --muted: #5f7084;
    --line: #bfd0e3;
    --accent: #2f70c9;
    --warn: #8c713d;
    --danger: #983d43;
    --shadow-soft: 0 8px 20px rgba(19, 40, 63, 0.08);
    --shadow-strong: 0 14px 30px rgba(19, 40, 63, 0.12);
    --theme-toggle-track: linear-gradient(180deg, #ffd778 0%, #f2bb42 100%);
    --theme-toggle-track-border: #d9ac47;
    --theme-toggle-thumb: #ffffff;
}

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

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

body {
    font-family: var(--font-ui);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(98, 128, 165, 0.18) 0, rgba(98, 128, 165, 0) 36%),
        radial-gradient(circle at 86% -4%, rgba(67, 90, 122, 0.22) 0, rgba(67, 90, 122, 0) 42%),
        linear-gradient(180deg, #1b242e 0%, #181f28 100%);
    background-attachment: fixed;
    display: flex;
}

a {
    color: var(--accent);
}

a:hover {
    color: #ffffff;
}

.app-shell {
    width: min(1140px, calc(100% - 1.2rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0;
}

.app-heading h1 {
    margin: 0;
    font-family: var(--font-pixel);
    font-size: clamp(1.2rem, 3.2vw, 2.05rem);
    line-height: 1.2;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.subtitle {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.theme-toggle {
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.theme-toggle-track {
    width: 3.45rem;
    height: 1.75rem;
    border-radius: 999px;
    border: 1px solid var(--theme-toggle-track-border);
    background: var(--theme-toggle-track);
    position: relative;
    flex: 0 0 auto;
    box-shadow: var(--shadow-soft);
}

.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.theme-toggle-icon-dark {
    left: 0.5rem;
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    background: #d7e4f6;
}

.theme-toggle-icon-dark::after {
    content: "";
    position: absolute;
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    left: 0.24rem;
    top: -0.02rem;
    background: var(--theme-toggle-track);
}

.theme-toggle-icon-light {
    right: 0.48rem;
    width: 0.56rem;
    height: 0.56rem;
    border-radius: 50%;
    background: #fff3b4;
    box-shadow: 0 0 0 1px rgba(255, 250, 228, 0.35);
}

.theme-toggle-thumb {
    width: 1.34rem;
    height: 1.34rem;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 0.18rem;
    background: var(--theme-toggle-thumb);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transform: translateY(-50%);
    transition: transform 0.22s ease;
}

html[data-theme="light"] .theme-toggle-thumb {
    transform: translate(1.74rem, -50%);
}

.selectItem {
    width: 100%;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.72rem 2rem 0.72rem 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.96rem;
    color: var(--text);
    background-color: var(--panel-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.1 6 7.9l3.8-3.8' fill='none' stroke='%23f4f6fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 0.65rem center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.selectItem option {
    color: var(--text);
    background-color: #2a3644;
}

.selectItem:hover {
    border-color: #4f5f72;
}

.selectItem:focus,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
    gap: 1rem;
    flex: 1;
}

#left,
#right {
    padding: 0.9rem;
}

.item-selector-card {
    padding: 0;
}

.item-selector-card .section-heading {
    display: block;
    margin-bottom: 0.45rem;
}

.item-select-shell {
    display: block;
}

.item-select-icon-unenchanted {
    filter: drop-shadow(0 0 5px rgba(166, 188, 214, 0.32));
}

.item-select-field {
    position: relative;
    min-width: 0;
}

.selectItem-native-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    min-height: 74px;
    border: 1px solid #4a5a6d;
    border-radius: var(--radius-sm);
    padding: 0.62rem 0.9rem;
    font-family: var(--font-ui);
    font-size: 1.16rem;
    color: var(--text);
    background: linear-gradient(180deg, #2b3744 0%, #25303b 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.custom-select-trigger-main {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 0;
    flex: 1 1 auto;
}

.custom-select-trigger-icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    position: relative;
    place-items: center;
    display: grid;
    flex: 0 0 auto;
    overflow: hidden;
}

.custom-select-trigger-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 154, 191, 0.48) 0%, rgba(126, 154, 191, 0) 72%);
    pointer-events: none;
    transform: translate(-50%, -50%) translateY(0px);
    z-index: 0;
    will-change: transform, opacity;
}

.custom-select-trigger-glow-secondary {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) translateY(58px);
}

.custom-select-trigger-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(0px);
    z-index: 1;
    will-change: transform, opacity;
}

.custom-select-trigger-icon-secondary {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) translateY(58px);
}

.custom-select-trigger:hover {
    border-color: #7a92ac;
}

.custom-select-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.custom-select.is-open .custom-select-trigger {
    border-color: #8eb3ff;
    box-shadow: 0 0 0 1px rgba(160, 189, 255, 0.24);
}

.custom-select-value {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger.is-placeholder .custom-select-value {
    color: #c5cfdd;
}

.custom-select-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid #dce5f3;
    border-bottom: 2px solid #dce5f3;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.18s ease;
    flex: 0 0 auto;
}

.custom-select.is-open .custom-select-caret {
    transform: rotate(-135deg) translateY(-1px);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 32;
    max-height: min(64vh, 28rem);
    overflow-y: auto;
    padding: 0.36rem;
    border-radius: 0.8rem;
    border: 1px solid #4f6075;
    background: linear-gradient(180deg, #2a3441 0%, #212b36 100%);
    box-shadow: var(--shadow-strong);
    scrollbar-width: thin;
    scrollbar-color: #8ea5bf #202b37;
    animation: dropdownFadeIn 0.14s ease;
}

.custom-select-section {
    padding: 0.12rem 0;
}

.custom-select-section + .custom-select-section {
    margin-top: 0.2rem;
    border-top: 1px solid rgba(145, 166, 192, 0.28);
    padding-top: 0.32rem;
}

.custom-select-group-label {
    margin: 0;
    padding: 0.28rem 0.62rem 0.24rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b7c7d9;
}

.custom-select-menu::-webkit-scrollbar {
    width: 11px;
}

.custom-select-menu::-webkit-scrollbar-track {
    background: #202b37;
    border-radius: 999px;
}

.custom-select-menu::-webkit-scrollbar-thumb {
    border: 2px solid #202b37;
    border-radius: 999px;
    background: linear-gradient(180deg, #9bb2ca 0%, #6f89a8 100%);
}

.custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #abc1d8 0%, #7f99b8 100%);
}

.custom-select-option {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.56rem;
    min-height: 44px;
    padding: 0.64rem 0.72rem;
    margin: 0;
    font-family: var(--font-ui);
    font-size: 1.06rem;
    line-height: 1.25;
    color: #edf2fb;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.custom-select-option-main {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    min-width: 0;
}

.custom-select-option-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    image-rendering: pixelated;
    flex: 0 0 auto;
}

.custom-select-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
    border-color: #6f86a2;
    background: rgba(118, 143, 171, 0.2);
    outline: none;
}

.custom-select-option.is-selected {
    border-color: #8eb3ff;
    color: #ffffff;
    background: rgba(97, 144, 219, 0.3);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-heading {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 600;
}

.enchants-heading-row {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    margin-bottom: 0.7rem;
}

.enchants-heading-row .section-heading {
    margin: 0;
}

.pugs-choice-buttons {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pugs-choice-button {
    min-width: 2.05rem;
    height: 2.05rem;
    border: 1px solid #546171;
    border-radius: 0.5rem;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    color: #f9f3b2;
    background: linear-gradient(180deg, #39485a 0%, #303d4e 100%);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.12s ease, color 0.2s ease;
}

.pugs-choice-star {
    display: block;
    font-size: 1.24rem;
    line-height: 1;
}

.pugs-choice-tag {
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.pugs-choice-button:hover:not(:disabled) {
    border-color: #7d92aa;
    background: linear-gradient(180deg, #42556b 0%, #36485e 100%);
    transform: translateY(-1px);
}

.pugs-choice-button.is-selected {
    border-color: #e3bc63;
    color: #fff8da;
    background: linear-gradient(180deg, #4f5f74 0%, #425266 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 241, 181, 0.42);
}

.pugs-choice-button:disabled {
    border-color: #4f5d6f;
    color: #8292a6;
    background: #323d4a;
    cursor: not-allowed;
    transform: none;
}

#enchants {
    margin-top: 0.85rem;
    padding: 0;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 52vh;
    background: linear-gradient(180deg, #212d3a 0%, #1e2934 100%);
    box-shadow: var(--shadow-strong);
    scrollbar-width: thin;
    scrollbar-color: #6f86a2 #202b37;
    scrollbar-gutter: auto;
}

.table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #202b37;
    border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid #202b37;
    background: linear-gradient(180deg, #8ea5bf 0%, #67809f 100%);
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a1b8d2 0%, #7590b0 100%);
}

.table-wrap::-webkit-scrollbar-corner {
    background: #202b37;
}

#enchants table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

#enchants td {
    padding: 0.52rem 0.58rem;
    color: var(--text);
    border-bottom: 1px solid #344355;
}

#enchants tr:last-child td {
    border-bottom: 0;
}

#enchants td:first-child {
    width: 11.8rem;
    padding: 0.52rem 0.22rem 0.52rem 0.58rem;
}

.enchant-name {
    display: block;
    color: #e7edf8;
    font-size: 0.94rem;
    line-height: 1.3;
    font-weight: 600;
}

#enchants td.level-buttons-cell {
    padding: 0.52rem 0.58rem 0.52rem 0;
}

.level-buttons {
    display: flex;
    align-items: center;
    gap: 0.44rem;
    flex-wrap: wrap;
}

#enchants tr.group1 td {
    background-color: #25303d;
}

#enchants tr.group2 td {
    background-color: #2a3642;
}

#enchants tr.is-selected td {
    background-color: #314055;
}

#enchants tr.is-selected .enchant-name {
    color: #edf2fb;
}

#enchants tr.is-conflicting td {
    background-color: #2e3540;
}

#enchants tr.is-conflicting .enchant-name {
    color: #95a3b5;
}

#enchants tr.is-conflicting button.level-button {
    border-color: #4f5d6f;
    background: #323c49;
    color: #95a3b5;
    box-shadow: none;
}

#enchants button.level-button {
    width: 2.05rem;
    height: 2.05rem;
    border: 1px solid #546171;
    border-radius: 0.5rem;
    padding: 0;
    color: var(--text);
    background: #39485a;
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

#enchants button.level-button:hover {
    border-color: #7d92aa;
    background: #42556b;
    transform: translateY(-1px);
}

#enchants button.level-button.on {
    border-color: #8eb3ff;
    background: #34599a;
    box-shadow: 0 0 0 1px rgba(160, 189, 255, 0.26);
}

#final-preview {
    margin-top: 1rem;
}

.final-preview-card {
    margin: 0 auto;
    padding: 0.8rem 0.85rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #425061;
    background: radial-gradient(circle at 30% 24%, #374455, #26313d 78%);
    box-shadow: var(--shadow-strong);
    display: grid;
    justify-items: center;
    gap: 0.62rem;
}

.final-preview-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    image-rendering: pixelated;
}

.final-preview-icon-unenchanted {
    filter: drop-shadow(0 0 5px rgba(166, 188, 214, 0.32));
}

.final-preview-icon-enchanted {
    filter: saturate(1.16) contrast(1.08) drop-shadow(0 0 6px rgba(124, 157, 255, 0.65));
}

.final-preview-enchants {
    margin: 0.08rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.27rem;
    width: 100%;
    text-align: center;
}

.final-preview-enchants li {
    font-family: var(--font-pixel);
    font-size: 0.72rem;
    line-height: 1.26;
    color: #f7f9ff;
}

#error,
#phone-warn {
    margin-top: 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid #56657a;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: var(--shadow-soft);
}

#error {
    background: linear-gradient(170deg, #7b3940 0%, #5d272e 100%);
}

#phone-warn {
    background: linear-gradient(170deg, #745e34 0%, #584826 100%);
}

#solution {
    margin-top: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-main);
    padding: 1rem;
    box-shadow: var(--shadow-strong);
}

#solution-header {
    margin: 0;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: clamp(1.45rem, 4vw, 2.55rem);
    line-height: 1.2;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.total-cost-row {
    margin: 0.55rem 0 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-pixel);
    line-height: 1;
}

.xp-orb {
    width: 20px;
    height: 20px;
    display: block;
    align-self: center;
    background-image: url("./images/xp_orb.gif");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 0 4px rgba(111, 255, 148, 0.6));
    transform: translateY(1px);
}

#total-cost-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

#level-cost {
    font-size: clamp(0.8rem, 2.6vw, 1.15rem);
    letter-spacing: 0.02em;
}

#solution h3 {
    margin: 0;
    display: none;
}

#steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

#steps li.step-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.35rem 0.7rem;
    align-items: center;
    border: 1px solid #425164;
    border-radius: 0.7rem;
    padding: 0.5rem 0.6rem;
    background: var(--surface-card);
}

.step-number {
    font-family: var(--font-pixel);
    font-size: 1.55rem;
    color: #ffffff;
    text-align: right;
    line-height: 1;
}

.step-combine {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
}

.step-plus {
    font-family: var(--font-pixel);
    font-size: 1.95rem;
    line-height: 1;
    text-align: center;
    color: #ffffff;
}

.step-item {
    display: grid;
    justify-items: center;
    align-items: start;
    text-align: center;
    min-width: 0;
}

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

.step-item-icon-unenchanted {
    filter: drop-shadow(0 0 5px rgba(166, 188, 214, 0.32));
}

.step-item-icon-enchanted {
    filter: saturate(1.16) contrast(1.08) drop-shadow(0 0 6px rgba(124, 157, 255, 0.65));
}

.step-item-lines {
    margin-top: 0.2rem;
    font-family: var(--font-pixel);
    font-size: clamp(0.62rem, 1.9vw, 1.05rem);
    line-height: 1.26;
    color: #f7f9ff;
    word-break: break-word;
}

.step-item-line {
    display: block;
}

.step-meta {
    display: none;
}

.footer {
    margin-top: 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.8rem;
}

.footer p {
    margin: 0;
    color: var(--muted);
}

.footer-project-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-self: start;
    gap: 0.55rem;
    min-width: 0;
}

.footer-project-links a {
    text-decoration: none;
    color: var(--muted);
    opacity: 0.74;
    transition: opacity 0.2s ease;
}

.footer-project-links a:hover,
.footer-project-links a:focus-visible {
    opacity: 1;
}

.footer a,
.footer a:visited,
.footer a:hover,
.footer a:focus-visible,
.footer a:active {
    color: inherit;
}

.footer-vibe-link {
    justify-self: center;
    color: var(--muted);
    text-decoration: none;
    opacity: 0.78;
    transition: opacity 0.2s ease;
}

.footer-vibe-link:hover,
.footer-vibe-link:focus-visible {
    opacity: 1;
}

.footer-credit {
    justify-self: end;
    text-align: right;
}

.footer-credit a {
    text-underline-offset: 2px;
}

html[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 12% 8%, rgba(131, 166, 207, 0.24) 0, rgba(131, 166, 207, 0) 40%),
        radial-gradient(circle at 86% -4%, rgba(185, 205, 230, 0.35) 0, rgba(185, 205, 230, 0) 45%),
        linear-gradient(180deg, #f3f8fd 0%, #e8f0f8 100%);
}

html[data-theme="light"] a:hover {
    color: #244f99;
}

html[data-theme="light"] .app-heading h1 {
    text-shadow: 0 2px 0 rgba(150, 172, 197, 0.55);
}

html[data-theme="light"] .selectItem {
    border-color: #b5c8db;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.1 6 7.9l3.8-3.8' fill='none' stroke='%23314868' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-theme="light"] .selectItem option {
    background-color: #ffffff;
    color: #1f3348;
}

html[data-theme="light"] .selectItem:hover {
    border-color: #7f9cbc;
}

html[data-theme="light"] .custom-select-trigger {
    border-color: #b5c8db;
    background: linear-gradient(180deg, #ffffff 0%, #eff5fc 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .custom-select-trigger:hover {
    border-color: #7f9cbc;
}

html[data-theme="light"] .custom-select-trigger-icon-wrap {
    background: transparent;
}

html[data-theme="light"] .custom-select-trigger-glow {
    background: radial-gradient(circle, rgba(126, 154, 191, 0.34) 0%, rgba(126, 154, 191, 0) 72%);
}

html[data-theme="light"] .custom-select.is-open .custom-select-trigger {
    border-color: #5f8fcb;
    box-shadow: 0 0 0 1px rgba(95, 143, 203, 0.24);
}

html[data-theme="light"] .custom-select-trigger.is-placeholder .custom-select-value {
    color: #6f8195;
}

html[data-theme="light"] .custom-select-caret {
    border-right-color: #4b6481;
    border-bottom-color: #4b6481;
}

html[data-theme="light"] .custom-select-menu {
    border-color: #b5c8db;
    background: linear-gradient(180deg, #ffffff 0%, #edf3fb 100%);
    scrollbar-color: #9eb5ce #dfe9f4;
}

html[data-theme="light"] .custom-select-section + .custom-select-section {
    border-top-color: rgba(125, 147, 172, 0.32);
}

html[data-theme="light"] .custom-select-group-label {
    color: #627a95;
}

html[data-theme="light"] .custom-select-menu::-webkit-scrollbar-track {
    background: #dfe9f4;
}

html[data-theme="light"] .custom-select-menu::-webkit-scrollbar-thumb {
    border-color: #dfe9f4;
    background: linear-gradient(180deg, #a7bdd5 0%, #83a0bf 100%);
}

html[data-theme="light"] .custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b4c8de 0%, #92acc9 100%);
}

html[data-theme="light"] .custom-select-option {
    color: #1f3348;
}

html[data-theme="light"] .custom-select-option:hover,
html[data-theme="light"] .custom-select-option:focus-visible {
    border-color: #8ca7c3;
    background: rgba(95, 143, 203, 0.14);
}

html[data-theme="light"] .custom-select-option.is-selected {
    border-color: #5f8fcb;
    color: #1a2d42;
    background: rgba(95, 143, 203, 0.22);
}

html[data-theme="light"] .pugs-choice-button {
    border-color: #9eb3c8;
    color: #876826;
    background: linear-gradient(180deg, #e5edf7 0%, #dbe7f4 100%);
}

html[data-theme="light"] .pugs-choice-button:hover:not(:disabled) {
    border-color: #7f9cbc;
    background: linear-gradient(180deg, #d8e5f3 0%, #cedef0 100%);
}

html[data-theme="light"] .pugs-choice-button.is-selected {
    border-color: #b17e2f;
    color: #6d4d1f;
    background: linear-gradient(180deg, #f7f0da 0%, #f1e5c3 100%);
    box-shadow: inset 0 0 0 1px rgba(193, 145, 61, 0.34);
}

html[data-theme="light"] .pugs-choice-button:disabled {
    border-color: #becddd;
    color: #90a0b4;
    background: #e7eef6;
}

html[data-theme="light"] .table-wrap {
    background: linear-gradient(180deg, #ffffff 0%, #edf3fb 100%);
    scrollbar-color: #8ca7c3 #dfe9f4;
}

html[data-theme="light"] .table-wrap::-webkit-scrollbar-track {
    background: #dfe9f4;
}

html[data-theme="light"] .table-wrap::-webkit-scrollbar-thumb {
    border-color: #dfe9f4;
    background: linear-gradient(180deg, #9ab2cc 0%, #7898b9 100%);
}

html[data-theme="light"] .table-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a9bfd7 0%, #86a5c4 100%);
}

html[data-theme="light"] .table-wrap::-webkit-scrollbar-corner {
    background: #dfe9f4;
}

html[data-theme="light"] #enchants td {
    border-bottom-color: #d2deea;
}

html[data-theme="light"] .enchant-name {
    color: #283a4d;
}

html[data-theme="light"] #enchants tr.group1 td {
    background-color: #f9fbfe;
}

html[data-theme="light"] #enchants tr.group2 td {
    background-color: #f1f6fc;
}

html[data-theme="light"] #enchants tr.is-selected td {
    background-color: #dce9f8;
}

html[data-theme="light"] #enchants tr.is-selected .enchant-name {
    color: #1e3248;
}

html[data-theme="light"] #enchants tr.is-conflicting td {
    background-color: #e9eff6;
}

html[data-theme="light"] #enchants tr.is-conflicting .enchant-name {
    color: #7d8ea1;
}

html[data-theme="light"] #enchants tr.is-conflicting button.level-button {
    border-color: #becddd;
    background: #e7eef6;
    color: #7d8ea1;
}

html[data-theme="light"] #enchants button.level-button {
    border-color: #9eb3c8;
    background: #e5edf7;
    color: #1b2a3a;
}

html[data-theme="light"] #enchants button.level-button:hover {
    border-color: #7f9cbc;
    background: #d8e5f3;
}

html[data-theme="light"] #enchants button.level-button.on {
    border-color: #3f73ba;
    background: #4b82d3;
    color: #f3f7ff;
    box-shadow: 0 0 0 1px rgba(63, 115, 186, 0.22);
}

html[data-theme="light"] .final-preview-card {
    border-color: #c1d0df;
    background: radial-gradient(circle at 30% 24%, #ffffff, #e8f0fa 78%);
}

html[data-theme="light"] .final-preview-enchants li {
    color: #23364a;
}

html[data-theme="light"] #error,
html[data-theme="light"] #phone-warn {
    border-color: #c2cedb;
}

html[data-theme="light"] #error {
    background: linear-gradient(170deg, #f9e0e3 0%, #f2cfd3 100%);
}

html[data-theme="light"] #phone-warn {
    background: linear-gradient(170deg, #f3ead6 0%, #e8dcc2 100%);
}

html[data-theme="light"] #solution-header {
    text-shadow: 0 2px 0 rgba(150, 172, 197, 0.55);
}

html[data-theme="light"] #steps li.step-card {
    border-color: #c3d3e4;
}

html[data-theme="light"] .step-number,
html[data-theme="light"] .step-plus {
    color: #1e3146;
}

html[data-theme="light"] .step-item-lines {
    color: #23364a;
}

@media (max-width: 980px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .app-shell {
        width: calc(100% - 0.6rem);
        padding-top: 0.55rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-toggle {
        align-self: flex-end;
    }

    #left,
    #right {
        padding: 0.7rem;
    }

    .custom-select-trigger {
        min-height: 66px;
    }

    .custom-select-trigger-icon-wrap {
        width: 44px;
        height: 44px;
    }

    .custom-select-trigger-icon {
        width: 36px;
        height: 36px;
    }

    .final-preview-card {
        padding: 0.68rem 0.7rem 0.64rem;
    }

    .final-preview-icon {
        width: 62px;
        height: 62px;
    }

    #enchants td:first-child {
        width: 9.4rem;
    }

    #enchants button.level-button {
        width: 1.9rem;
        height: 1.9rem;
    }

    .pugs-choice-button {
        min-width: 1.9rem;
        height: 1.9rem;
        padding: 0 0.42rem;
        gap: 0.24rem;
    }

    .pugs-choice-tag {
        font-size: 0.62rem;
    }

    #steps li.step-card {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .step-number {
        font-size: 1.2rem;
    }

    .step-combine {
        grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
        gap: 0.4rem;
    }

    .step-plus {
        font-size: 1.35rem;
    }

    .step-item-icon {
        width: 54px;
        height: 54px;
    }

    .footer {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.35rem;
        text-align: center;
    }

    .footer-project-links {
        justify-self: center;
        justify-content: center;
    }

    .footer-vibe-link,
    .footer-credit {
        justify-self: center;
        text-align: center;
    }
}
