/* MINING CALCULATOR page: pool facts, the setup panel and the earnings panel.
   The shared theme (colours, rail, header, transitions) stays inline in
   calculator.html; everything below the header lives here so it can be tuned
   without touching the CSP-hashed inline block. The logic is in calculator.js. */

/* --- pool facts: the same cards as the rest of the site --- */
.pool-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.4rem 0 1.6rem;
}
.fact-card {
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    padding: 1.1rem 0.9rem;
    text-align: center;
    transition: all 0.25s ease;
}
.fact-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.fact-label {
    font-size: 0.55em;
    color: var(--muted);
    letter-spacing: 1.5px;
    margin-bottom: 0.7rem;
}
.fact-value {
    font-size: 0.95em;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
}
.fact-value.gold {
    color: var(--gold);
}
.fact-value .loading {
    color: var(--muted);
    font-size: 0.7em;
}

/* --- two panels --- */
.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: stretch;
}
/* Near-solid, like the network chart and the HASHRATE page's panel: the
   background network shows around the panels, not through the figures */
.calc-panel {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    background: rgba(18, 18, 18, 0.96);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    padding: 1.4rem 1.5rem 1.5rem;
}
.calc-title {
    margin: 0 0 1.2rem;
    padding-bottom: 0.8rem;
    font-size: 0.85em;
    font-weight: normal;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
}

/* --- inputs --- */
.calc-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
}
.calc-field + .calc-field,
.calc-field-row {
    margin-top: 1.1rem;
}
.calc-field-row .calc-field {
    margin-top: 0;
}
.calc-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.calc-label {
    font-size: 0.5em;
    letter-spacing: 2px;
    color: var(--muted);
}
.calc-input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--text-color);
    background: #050505;
    border: 2px solid var(--border-color);
    -moz-appearance: textfield;
}
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.calc-input::placeholder {
    color: #4a4a4a;
}
.calc-input:focus {
    outline: none;
    border-color: var(--accent-color);
}
.calc-hashrate {
    display: flex;
    gap: 0.6rem;
}
.calc-hashrate .calc-input {
    flex: 1;
}
.calc-units {
    display: inline-flex;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: var(--tab-inactive);
}
.calc-unit {
    padding: 0 0.8rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55em;
    color: var(--muted);
    background: none;
    border: 0;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}
.calc-unit:first-child {
    border-left: 0;
}
.calc-unit:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}
.calc-unit[aria-pressed="true"] {
    color: var(--main-bg);
    background: var(--accent-color);
}
.calc-unit:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

/* --- mini stats under the inputs --- */
/* The stats fill whatever height the earnings panel sets, so both panels match */
.calc-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.8rem;
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}
.calc-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
}
.calc-stat-label {
    font-size: 0.48em;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 0.55rem;
}
.calc-stat-value {
    font-size: 0.72em;
    color: var(--text-color);
    white-space: nowrap;
}
.calc-stat-value.gold {
    color: var(--gold);
}
.calc-stat-value .loading {
    color: var(--muted);
    font-size: 0.85em;
}

/* --- earnings --- */
.calc-hero {
    padding: 1.3rem 1rem 1.2rem;
    text-align: center;
    border: 2px solid var(--accent-color);
    background: rgba(135, 255, 135, 0.07);
    box-shadow: 0 0 0 1px rgba(135, 255, 135, 0.25), 0 0 18px rgba(135, 255, 135, 0.18);
}
.calc-hero-label {
    font-size: 0.55em;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 0.9rem;
}
.calc-hero-value {
    font-size: 1.7em;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(135, 255, 135, 0.35);
    white-space: nowrap;
}
.calc-hero-coin {
    font-size: 0.45em;
    color: var(--text-color);
    margin-left: 0.4rem;
}
.calc-hero-usd {
    margin-top: 0.8rem;
    font-size: 0.75em;
    color: var(--text-color);
    min-height: 1em;
}
/* With a power draw and price: REVENUE | POWER | PROFIT a day under the daily
   figure, label over value split by thin rules (the network chart head's
   style); PROFIT green, red when the power costs more */
.calc-profit {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(135, 255, 135, 0.3);
}
.calc-profit[hidden] {
    display: none;
}
.calc-profit-item {
    display: grid;
    gap: 8px;
    padding: 0 1.4rem;
    border-left: 1px solid var(--border-color);
}
.calc-profit-item:first-child {
    border-left: 0;
}
.calc-profit-label {
    font-size: 0.45em;
    letter-spacing: 1.5px;
    color: var(--muted);
}
.calc-profit-value {
    font-size: 0.7em;
    color: var(--text-color);
    white-space: nowrap;
}
.calc-profit-net {
    color: var(--green);
}
.calc-profit-net.negative {
    color: var(--red-soft);
}
.calc-periods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.9rem;
}
.calc-period {
    padding: 0.9rem 0.6rem;
    text-align: center;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.25s ease;
}
.calc-period:hover {
    border-color: var(--hover-color);
}
.calc-period-label {
    font-size: 0.48em;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 0.7rem;
}
.calc-period-value {
    font-size: 0.8em;
    color: var(--text-color);
    white-space: nowrap;
}
.calc-period-coin {
    font-size: 0.42em;
    color: var(--muted);
    margin-left: 0.3rem;
}
.calc-period-usd {
    margin-top: 0.55rem;
    font-size: 0.52em;
    color: var(--gold);
    min-height: 1em;
}
.calc-expect {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.9rem;
}
.calc-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.2rem;
    padding: 0.85rem 1rem;
    font-size: 0.6em;
    letter-spacing: 1px;
    text-decoration: none;
    color: var(--main-bg);
    background: var(--accent-color);
    border: 2px solid var(--accent-color);
    transition: all 0.25s ease;
}
.calc-cta:hover {
    background: var(--gold);
    border-color: var(--gold);
}
.calc-cta svg {
    flex-shrink: 0;
}

/* The pool's note under the earnings at today's difficulty */
.calc-note {
    margin: 1rem 0 0;
    font-size: 0.48em;
    line-height: 1.8;
    letter-spacing: 1px;
    color: var(--muted);
    text-align: center;
}

/* --- network hashrate by window, right under the fact cards: the
   dashboard's chart panel and chart (calculator.js). Its head carries the 24H
   average as the main figure with its error, 7D as the trend and the
   difficulty direction --- */
.pool-chart-panel {
    margin: 0 0 1.6rem;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    padding: 1.1rem 1.1rem 0.6rem;
}
/* Near-solid, as on the HASHRATE page: the background network still shows
   around the panel but no longer runs through the chart */
.net-chart-panel {
    background: rgba(18, 18, 18, 0.96);
}
.net-chart-panel[hidden] {
    display: none;
}
.net-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}
.pool-chart-title {
    margin: 0;
    font-size: 0.65em;
    font-weight: normal;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--glow-color);
}
/* The head's figures: label over value, split by thin rules; 24H AVERAGE,
   the main figure, larger and gold with its error beside it */
.net-stats {
    display: flex;
    align-items: stretch;
}
.net-stat {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 0 1.2rem;
    border-left: 1px solid var(--border-color);
}
.net-stat:first-child {
    border-left: 0;
}
.net-stat:last-child {
    padding-right: 0;
}
.net-stat-label {
    font-size: 0.45em;
    letter-spacing: 1.5px;
    color: var(--muted);
}
.net-stat-value {
    font-size: 0.7em;
    color: var(--text-color);
    white-space: nowrap;
}
.net-stat-main .net-stat-value b {
    font-weight: normal;
    font-size: 1.3em;
    color: var(--gold);
}
.net-stat-err {
    margin-left: 0.6em;
    font-size: 0.8em;
    color: var(--muted);
}
/* Quicker blocks than the 30 s target: difficulty rising, so a hash earns
   less (red); slower: falling (green) */
.trend-difficulty.is-rising {
    color: var(--red-soft);
}
.trend-difficulty.is-falling {
    color: var(--green);
}
.net-chart {
    width: 100%;
    height: 240px;
}
.net-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ===== Pixel corners: frame colour, width and transitions (see responsive.css) ===== */
/* copied from calculator.css */
.calc-panel {
    --u: 2px;
    --px-line: var(--border-color);
}
