/* ─────────────────────────────────────────────
   OSRS League – Ore Transmutation Calculator
   ───────────────────────────────────────────── */

:root {
    --bg:          #1a1a2e;
    --surface:     #16213e;
    --card:        #0f3460;
    --accent:      #e94560;
    --gold:        #f5a623;
    --text:        #eaeaea;
    --text-muted:  #9ba4b5;
    --border:      #2a3a5c;
    --green:       #4caf50;
    --blue:        #42a5f5;
    --font:        'Segoe UI', system-ui, sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    padding: 24px 16px 48px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

h1 {
    font-size: 1.8rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.settings-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-grid label a { color: var(--gold); text-decoration: none; }
.settings-grid label a:hover { text-decoration: underline; }

.settings-grid input,
.settings-grid select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 8px 12px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s;
}

.settings-grid input:focus,
.settings-grid select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Notes */
.note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Tables */
.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

thead th {
    background: var(--surface);
    color: var(--gold);
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:hover { background: rgba(255,255,255,0.04); }

tbody td {
    padding: 9px 12px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Ore name cells */
td.ore-name {
    font-weight: 600;
    color: var(--text);
}

td.in-chain  { color: var(--blue); }
td.not-chain { color: var(--text-muted); }

/* Ore / GP icons */
.ore-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    image-rendering: pixelated;
}

.gp-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 3px;
    image-rendering: pixelated;
}

/* Best strategy badge */
.best-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(76,175,80,0.20);
    color: var(--green);
    border: 1px solid var(--green);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Best strategy row */
tr.best-row td { background: rgba(76,175,80,0.12); }
tr.best-row td:first-child { border-left: 3px solid var(--green); }

/* Highlight scenarios */
tr.scenario-best td { background: rgba(76,175,80,0.10); }
tr.scenario-no-tx   td { background: rgba(255,255,255,0.03); }

/* Ore rows that cannot be transmuted (silver / gold) */
tr.ore-no-chain td { color: #c97070; }
tr.ore-no-chain td.ore-name { color: #c97070; }

/* GP values */
td.gp { font-variant-numeric: tabular-nums; text-align: right; }
td.gp-increase  { font-variant-numeric: tabular-nums; text-align: right; color: var(--green); }
td.gp-neutral   { text-align: right; color: var(--text-muted); }
td.gp-overload  { font-variant-numeric: tabular-nums; text-align: right; color: var(--gold); }

/* Sub-label inside <th> */
.th-sub {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Chain pill */
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.pill-yes { background: rgba(66,165,245,0.18); color: var(--blue); border: 1px solid var(--blue); }
.pill-no  { background: rgba(155,164,181,0.12); color: var(--text-muted); border: 1px solid var(--border); }

/* Breakdown selector */
.breakdown-selector {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.breakdown-selector label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breakdown-selector select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 6px 12px;
    font-size: 0.95rem;
    cursor: pointer;
}

.breakdown-selector select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Transmutation arrow rows */
tr.transmuted td { color: var(--blue); }
tr.sold-direct td { color: var(--text-muted); }
tr.total-row   td { font-weight: 700; color: var(--gold); border-top: 2px solid var(--border); }

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 12px;
}

footer a { color: var(--gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Responsive tweaks */
@media (max-width: 600px) {
    h1 { font-size: 1.3rem; }
    .card { padding: 14px 12px; }
}
