:root {
    color-scheme: dark;
    --bg: #12110d;
    --panel: #1f1a13;
    --panel-2: #2a2318;
    --line: #4c3d27;
    --text: #f5ead5;
    --muted: #bba987;
    --soft: #8f7c5f;
    --gold: #d8a844;
    --green: #6fd08c;
    --red: #ff8b78;
    --blue: #73b7e8;
    --shadow: 0 18px 60px rgba(0, 0, 0, .28);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: linear-gradient(rgba(18, 17, 13, .8), rgba(18, 17, 13, .94)),
    url("https://oldschool.runescape.wiki/w/Special:FilePath/Attack%20on%20Varrock%201920x1200.jpg") center center / cover fixed,
    var(--bg);
}

main {
    width: 100%;
    flex: 1 0 auto;
}

.shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.thin-header {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(216, 168, 68, .22);
    background: linear-gradient(180deg, rgba(18, 17, 13, .9), rgba(18, 17, 13, .82)),
    radial-gradient(circle at 50% -30%, rgba(216, 168, 68, .18), transparent 55%);
}

.thin-header .shell {
    display: flex;
    justify-content: center;
}

.thin-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    line-height: 1;
    color: var(--gold);
    text-shadow: 0 2px 0 #5c3d14;
    letter-spacing: .01em;
}

button,
input,
select {
    font: inherit;
}

.hero {
    min-height: 168px;
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 0 16px 14px;
    border-bottom: 1px solid rgba(216, 168, 68, .22);
    background: linear-gradient(180deg, rgba(18, 17, 13, .78), rgba(18, 17, 13, .92)),
    radial-gradient(circle at 80% 20%, rgba(216, 168, 68, .16), transparent 36%);
    backdrop-filter: blur(2px);
}

.hero .shell {
    display: grid;
    justify-items: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 0 0;
    flex-wrap: wrap;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.05;
    color: var(--gold);
    text-shadow: 0 2px 0 #5c3d14;
}

h2 {
    font-size: 1.15rem;
    line-height: 1.2;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.price-pill {
    min-width: 128px;
    padding: 6px 10px;
    border: 1px solid rgba(216, 168, 68, .35);
    border-radius: 6px;
    background: rgba(31, 26, 19, .88);
    color: var(--muted);
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.hero-copy {
    max-width: 680px;
    color: var(--text);
    font-size: clamp(1.08rem, 2vw, 1.45rem);
    font-weight: 750;
    line-height: 1.25;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}

.hero-content p {
    max-width: 700px;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.38;
    font-size: .95rem;
}

.hero-title {
    text-align: center;
    margin-top: 10px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 14px;
    padding: 14px 16px 32px;
}

.lookup-panel,
.skill-card,
.method-panel {
    border: 1px solid rgba(216, 168, 68, .24);
    border-radius: 10px;
    background: rgba(31, 26, 19, .92);
    box-shadow: var(--shadow);
}

.side-panel {
    align-self: start;
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
}

.lookup-panel {
    padding: 14px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.method-count {
    flex: 0 0 auto;
    border: 1px solid rgba(216, 168, 68, .28);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(20, 16, 11, .82);
    color: var(--gold);
    font-size: .82rem;
    font-weight: 900;
}

.method-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.search-control {
    min-width: 0;
}

.toggle-control {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    background: #14100b;
    color: var(--text);
    cursor: pointer;
}

.toggle-control input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--gold);
}

.lookup-form,
.level-grid {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #14100b;
    color: var(--text);
    padding: 9px 10px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(216, 168, 68, .18);
}

button {
    min-height: 44px;
    border: 1px solid #f0c56b;
    border-radius: 6px;
    background: linear-gradient(#d8a844, #9f6f20);
    color: #1a1208;
    font-weight: 900;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.07);
}

.hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.player-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.summary-item {
    border: 1px solid rgba(216, 168, 68, .18);
    border-radius: 6px;
    padding: 10px;
    background: rgba(20, 16, 11, .7);
}

.summary-item span {
    display: block;
    color: var(--muted);
    font-size: .75rem;
}

.summary-item strong {
    color: var(--text);
    font-size: 1.05rem;
}

.hidden {
    display: none;
}

.calculator {
    min-width: 0;
}

.skill-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.skill-button {
    display: grid;
    justify-items: center;
    gap: 7px;
    min-height: 82px;
    padding: 9px 6px;
    border: 1px solid rgba(216, 168, 68, .22);
    border-radius: 8px;
    background: rgba(31, 26, 19, .88);
    color: var(--muted);
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.skill-button:hover {
    transform: translateY(-1px);
    border-color: rgba(216, 168, 68, .48);
}

.skill-button img {
    width: 30px;
    height: 30px;
    image-rendering: pixelated;
}

.skill-button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .76rem;
    font-weight: 800;
}

.skill-button.active {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(116, 78, 24, .82), rgba(57, 40, 19, .86));
    color: var(--text);
}

.skill-card {
    align-self: start;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.skill-card > img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

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

.totals {
    display: grid;
    gap: 10px;
}

.totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(216, 168, 68, .18);
    padding-top: 12px;
}

.totals span {
    color: var(--muted);
}

.method-panel {
    min-width: 0;
    padding: 14px;
}

.method-list {
    display: grid;
    gap: 10px;
}

.method-group {
    border: 1px solid rgba(216, 168, 68, .2);
    border-radius: 8px;
    background: rgba(20, 16, 11, .52);
    overflow: hidden;
}

.method-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    background: rgba(42, 35, 24, .58);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
}

.method-group summary small {
    color: var(--muted);
    font-size: .78rem;
}

.method-group-list {
    display: grid;
    gap: 10px;
    padding: 0 10px 10px;
}

.empty-state {
    border: 1px solid rgba(216, 168, 68, .18);
    border-radius: 8px;
    padding: 14px;
    background: rgba(20, 16, 11, .72);
    color: var(--muted);
}

.method {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    border: 1px solid rgba(216, 168, 68, .18);
    border-radius: 10px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(27, 22, 15, .9), rgba(18, 15, 11, .82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.method.is-unlocked {
    border-color: rgba(111, 208, 140, .34);
}

.method.is-locked {
    border-color: rgba(255, 139, 120, .28);
    background: linear-gradient(180deg, rgba(31, 21, 17, .88), rgba(18, 15, 11, .82));
}

.method h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 1rem;
}

.method h3 img {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    image-rendering: pixelated;
}

.method-meta,
.items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
}

.items {
    margin-top: 8px;
}

.items span {
    border-radius: 999px;
    padding: 2px 0;
}

.items .item-ok {
    color: var(--green);
}

.items .item-locked {
    color: var(--red);
}

.method-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
}

.tag {
    border: 1px solid rgba(216, 168, 68, .18);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(42, 35, 24, .8);
    color: var(--soft);
}

.tag.level-ok {
    border-color: rgba(111, 208, 140, .28);
    color: var(--green);
}

.tag.level-locked {
    border-color: rgba(255, 139, 120, .28);
    color: var(--red);
}

.gp {
    min-width: 164px;
    align-self: stretch;
    display: grid;
    align-content: center;
    border-left: 1px solid rgba(216, 168, 68, .16);
    padding-left: 14px;
    text-align: right;
}

.gp strong {
    display: block;
    font-size: 1.12rem;
}

.gp span {
    color: var(--muted);
    font-size: .82rem;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.neutral {
    color: var(--blue);
}

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

    .side-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .hero {
        min-height: 150px;
    }

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

    .price-pill {
        width: 100%;
    }

    .skill-strip {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

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

    .method-toolbar {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .gp {
        border-left: 0;
        border-top: 1px solid rgba(216, 168, 68, .16);
        padding-left: 0;
        padding-top: 10px;
        text-align: left;
    }
}

.brand,
.brand-link,
.nav-link,
.tool-card {
    color: inherit;
    text-decoration: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(216, 168, 68, .44);
    border-radius: 8px;
    font-weight: 900;
    font-size: .82rem;
    color: var(--gold);
    background: rgba(20, 16, 11, .78);
}

.brand strong {
    display: block;
    font-size: .9rem;
    color: var(--text);
    letter-spacing: .01em;
}

.brand .eyebrow {
    margin-bottom: 0;
}

.nav-link {
    border: 1px solid rgba(216, 168, 68, .35);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--gold);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .02em;
    transition: border-color .14s ease, background .14s ease;
}

.nav-link:hover {
    border-color: rgba(216, 168, 68, .62);
    background: rgba(42, 35, 24, .68);
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hero-content {
    max-width: 760px;
}

.hero.compact .hero-content p {
    max-width: 620px;
}

.page-shell {
    width: min(1080px, 100%);
    padding: 28px 16px 44px;
}

.section-heading {
    margin-bottom: 14px;
}

.tool-price-row {
    display: flex;
    justify-content: center;
    margin: 18px 0 18px;
}

.tool-price-row .price-pill {
    min-width: 200px;
    border-radius: 999px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

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

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

.tool-card {
    display: block;
    min-height: 184px;
    border: 1px solid rgba(216, 168, 68, .24);
    border-radius: 16px;
    padding: 18px 16px;
    background:
        radial-gradient(circle at 50% -30%, rgba(216, 168, 68, .22), transparent 56%),
        linear-gradient(170deg, rgba(33, 27, 19, .95), rgba(21, 17, 12, .94));
    box-shadow: 0 14px 30px rgba(0, 0, 0, .26);
    text-align: center;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(216, 168, 68, .54);
    box-shadow: 0 20px 38px rgba(0, 0, 0, .34);
}

.tool-card.is-ready {
    border-color: rgba(216, 168, 68, .44);
}

.tool-card h3 {
    margin: 0 0 8px;
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    letter-spacing: .01em;
}

.tool-card p {
    color: var(--muted);
    line-height: 1.4;
    font-size: .9rem;
    max-width: 30ch;
    margin: 0 auto;
}

.tool-status {
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid rgba(216, 168, 68, .34);
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(20, 16, 11, .72);
    color: var(--gold);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tool-card.is-ready .tool-status {
    border-color: rgba(111, 208, 140, .55);
    background: rgba(25, 54, 34, .55);
    color: #9cf0b4;
}

.tool-card:not(.is-ready) .tool-status {
    border-color: rgba(255, 139, 120, .45);
    background: rgba(63, 28, 21, .45);
    color: #ffb1a1;
}

.home-hero {
    display: grid;
    gap: 12px;
    justify-items: center;
    text-align: center;
    padding: 26px 20px 22px;
    margin: 0 auto 4px;
    border: 1px solid rgba(216, 168, 68, .22);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 0%, rgba(216, 168, 68, .2), transparent 54%),
        linear-gradient(180deg, rgba(33, 27, 19, .86), rgba(21, 17, 12, .9));
    box-shadow: 0 20px 46px rgba(0, 0, 0, .3);
}

.home-hero h2 {
    max-width: 18ch;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1.04;
    color: #f0dbb0;
    text-shadow: 0 8px 22px rgba(0, 0, 0, .34);
}

.home-hero p {
    max-width: 58ch;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

.home-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
}

.home-hero-tags span {
    border: 1px solid rgba(216, 168, 68, .26);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(16, 13, 9, .52);
    color: #e6c377;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.site-footer {
    margin-top: 14px;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(216, 168, 68, .2);
    background: linear-gradient(180deg, rgba(18, 17, 13, .72), rgba(18, 17, 13, .88));
}

.site-footer .shell {
    display: flex;
    justify-content: center;
}

.site-footer p {
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 14px;
    padding: 14px 16px 28px;
}

.app-shell {
    width: min(1440px, 100%);
}

.app-controls {
    align-self: start;
    position: sticky;
    top: 14px;
}

.app-option-groups {
    display: grid;
    gap: 12px;
}

.app-option-group {
    border: 1px solid rgba(216, 168, 68, .16);
    border-radius: 8px;
    padding: 8px;
    background: rgba(20, 16, 11, .45);
}

.app-option-group h3 {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: .84rem;
}

.app-form-grid {
    grid-template-columns: 1fr;
}

.app-toggle {
    min-height: 36px;
    font-size: .8rem;
    padding: 0 8px;
}

.app-row-locked {
    opacity: .52;
}

.app-table-wrap {
    min-width: 0;
}

.app-table-scroll {
    overflow: auto;
    border: 1px solid rgba(216, 168, 68, .15);
    border-radius: 8px;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    font-size: .94rem;
    table-layout: auto;
}

.app-table th,
.app-table td {
    padding: 9px 2px;
    border-bottom: 1px solid rgba(216, 168, 68, .12);
    text-align: center;
    white-space: nowrap;
    line-height: 1.35;
}

.app-table th:first-child,
.app-table td:first-child {
    text-align: center;
}

.app-table td small {
    color: var(--muted);
    font-size: .72rem;
}

.app-table th:nth-child(4),
.app-table td:nth-child(4),
.app-table .sell-cell {
    white-space: nowrap;
}

.app-table th {
    position: sticky;
    top: 0;
    background: rgba(31, 26, 19, .98);
    color: var(--gold);
    z-index: 1;
    cursor: pointer;
    user-select: none;
}

.app-table tbody tr:hover {
    background: rgba(42, 35, 24, .4);
}

.app-summary-card {
    margin: 12px 0;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(216, 168, 68, .16);
    border-radius: 8px;
    padding: 10px;
    background: rgba(20, 16, 11, .45);
}

.app-summary-card span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.app-summary-card strong {
    font-size: 1.02rem;
}

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

    .app-controls {
        position: static;
    }
}

@media (max-width: 760px) {
    .app-form-grid {
        grid-template-columns: 1fr;
    }

    .app-table {
        min-width: 640px;
        font-size: .88rem;
    }

    .app-table th,
    .app-table td {
        padding: 9px 3px;
    }
}

.snippet-box {
    margin-top: 12px;
    border: 1px solid rgba(216, 168, 68, .2);
    border-radius: 8px;
    background: rgba(20, 16, 11, .72);
    padding: 12px;
    overflow: auto;
    max-height: 580px;
}

.snippet-box code {
    font-family: "IBM Plex Mono", "Consolas", monospace;
    font-size: .84rem;
    line-height: 1.45;
    color: var(--text);
    white-space: pre;
}
