:root {
    --bg: #1e1e1e;
    --panel: #2b2b2b;
    --panel-2: #2f2f31;
    --border: #555;
    --muted: #aaaaaa;
    --accent: #3a8bff;
    --text: #e0e0e0;
    --card-shadow: rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

*::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

body {
    font-family: Arial, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    padding: 30px;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

.site-frame {
    display: grid;
    grid-template-columns: 18% 64% 18%;
    /* left 18%, center 64-65%, right 18% */
    gap: 6px;
    align-items: start;
    width: 100%;
    margin: 0;
}


/* Panels */
.panel {
    background: transparent;
}

.panel-inner {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 6px 18px var(--card-shadow);
}

/* Left/Right panels full height */
#left-panel .panel-inner,
#right-panel .panel-inner {
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Half-panel boxes */
.half-panel {
    height: 50%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    overflow-y: auto;
}

.half-panel:last-child {
    margin-bottom: 0;
}

/* Center panel */
.center-inner {
    padding: 12px;
}

#calculator-box {
    border-radius: 8px;
    padding: 12px;
}

#calculator-box h1 {
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: 20px;
    color: #fff;
}

/* ========= INPUT SECTIONS ========= */
.calc-flex {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.calc-left,
.calc-right {
    flex: 1;
}

.calc-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Ore rows */
.ore-rows {
    display: grid;
    gap: 10px;
}

.ore-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-wrapper {
    position: relative;
    width: 100%;
    /* expand to fill parent */
}

/* Ore & Rune text inputs */
.input-wrapper input.ore-search,
.input-wrapper input.rune-search {
    width: 100%;
    padding: 8px 34px 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}

/* Ore & Rune number inputs */
.ore-amt,
.rune-amt {
    width: 120px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}

/* Enhancement label & numeric box */
.enh-label,
.enh-amt {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}

.enh-label {
    user-select: none;
    pointer-events: none;
    opacity: 0.85;
}

/* Gap before enhancement row */
.enhancement-block {
    margin-top: 22px;
}

/* Number input wrapper */
.number-wrapper {
    display: flex;
    align-items: center;
}

.number-wrapper input {
    flex: 1;
    text-align: center;
}

/* Plus/minus buttons */
.num-btn {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: bold;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    transition: background .1s;
}

.num-btn:hover {
    background: #3a3a3a;
}

/* Clear button */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    color: #999;
    font-size: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Dropdown lists */
.ore-options,
.rune-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--panel-2);
    border: 1px solid #3c3c3e;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 4px;
    display: none;
    z-index: 999;
}

.ore-options li,
.rune-options li {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text);
    border-radius: 6px;
}

.ore-options li:hover,
.rune-options li:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Segmented buttons */
#trait-selector {
    display: flex;
    width: 100%;
    margin-top: 16px;
}

.seg-btn {
    flex: 1;
    margin: 0 2px;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: .12s;
    color: var(--text);
    font-weight: 600;
}

.seg-btn.active {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 -3px 0 var(--accent);
    border-color: var(--accent);
}

/* ========= RESULTS ========= */
.results-inner {
    margin-top: 18px;
    border-radius: 8px;
    padding: 14px;
    display: none;
}

#rarity-mult-box {
    margin-bottom: 14px;
}

/* Two-column split */
#results-split-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Cards */
.card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid #3c3c3e;
    border-radius: 8px;
    padding: 10px;
}

.card-header {
    font-size: 13px;
    color: var(--muted);
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.card-body {
    color: var(--text);
}

/* Composition & traits */
.comp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comp-row {
    display: flex;
    justify-content: space-between;
}

.comp-name {
    font-weight: 600;
}

.comp-pct {
    color: var(--muted);
}

.trait-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.trait-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.trait-line {
    color: var(--text);
    font-size: 13px;
}

.odds-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.odds-row {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.03);
    padding: 6px;
    border-radius: 6px;
}

.odds-name {
    font-weight: 600;
}

.odds-pct {
    color: var(--muted);
}

/* Warnings & muted */
.warning {
    margin-top: 10px;
    color: #ffcc66;
    font-weight: 600;
}

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

/* Ore list */
#ore-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Responsive */
@media (max-width:1100px) {
    .site-frame {
        grid-template-columns: 1fr;
    }

    #left-panel .panel-inner,
    #right-panel .panel-inner {
        height: auto;
    }

    #results-split-box {
        grid-template-columns: 1fr;
    }

    .input-wrapper {
        width: 100%;
    }
}

:root {
    --bg: #1e1e1e;
    --panel: #2b2b2b;
    --panel-2: #2f2f31;
    --border: #555;
    --muted: #aaaaaa;
    --accent: #3a8bff;
    --text: #e0e0e0;
    --card-shadow: rgba(0, 0, 0, 0.45);
}

body {
    font-family: Arial, system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 30px;
}

.site-frame {
    display: grid;
    grid-template-columns: 18% 64% 18%;
    gap: 6px;
}

/* Panels */
.panel-inner {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 6px 18px var(--card-shadow);
}

/* Half panels */
.half-panel {
    height: 50%;
    margin-bottom: 10px;
    border-radius: 8px;
    background: var(--panel-2);
    overflow-y: auto;
}

/* Ore list tooltip fix */
#ore-list li span {
    cursor: default;
}

#ore-list li span:hover {
    text-decoration: underline;
}

.ore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
}

#ore-search {
    background: #2b2b2b;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9em;
    width: 120px;
}

#ore-search::placeholder {
    color: #888;
}

.ore-slots {
    display: flex;
    gap: 8px;
}

.ore-slot {
    width: 80px;
    height: 80px;
    background: #2b2b2b;
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: 0.2s;
}

.ore-slot:hover {
    transform: scale(1.05);
    border-color: #aaa;
}

#ore-list {
    max-height: 300px;
    overflow-y: auto;
    color: var(--text);
}

#ore-list li {
    list-style: none;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
