@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --bg: #000;
    --surface: #060606;
    --surface-2: #0b0b0b;
    --line: #292929;
    --line-red: #5b1010;
    --red: #ff1a1a;
    --red-dark: #b90000;
    --green: #29df68;
    --green-dark: #123d21;
    --orange: #f7931a;
    --text: #f7f7f7;
    --muted: #a7a7a7;
    --muted-2: #6f6f6f;
}

html { color-scheme: dark; scroll-behavior: smooth; }

body {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

/* Exact site-standard falling code treatment used by the main mine page. */
.page-hash-rain {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    opacity: .95;
}

.hash-col {
    position: absolute;
    top: -100%;
    width: 1.2em;
    color: var(--red);
    font-family: 'Courier New', monospace;
    line-height: 1.2;
    text-align: center;
    white-space: pre-line;
    animation: hashFall var(--speed) linear infinite;
    animation-delay: var(--delay);
    opacity: .9;
    text-shadow: 0 0 10px rgba(255, 0, 0, .9), 0 0 22px rgba(255, 0, 0, .55);
}

@keyframes hashFall {
    0% { transform: translateY(-100%); opacity: 0; }
    10%, 90% { opacity: .95; }
    100% { transform: translateY(calc(100vh + 100%)); opacity: 0; }
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, .96);
    backdrop-filter: blur(12px);
}

.nav-inner {
    width: min(1320px, calc(100% - 40px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-red);
    border-radius: 4px;
    object-fit: cover;
}

.brand-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.brand-name span { color: var(--red); }

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.nav-links a[aria-current="page"], .nav-links a:hover, .nav-links a:focus-visible { color: var(--red); }

main { position: relative; z-index: 2; }

.identity-band {
    position: relative;
    min-height: 290px;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.identity-shell {
    position: relative;
    z-index: 2;
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 38px;
}

.top-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 520px);
    align-items: center;
    gap: 28px;
    margin-bottom: 36px;
}

.breadcrumb { color: var(--muted-2); font-size: .78rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span { margin: 0 8px; color: var(--red-dark); }

.miner-search {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--line-red);
    border-radius: 6px;
    background: rgba(3, 3, 3, .96);
}

.miner-search:focus-within { border-color: var(--red); }
.miner-search input {
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: .78rem;
}

.miner-search button {
    min-width: 104px;
    border: 0;
    border-left: 1px solid var(--line-red);
    background: #250000;
    color: var(--red);
    font-size: .78rem;
    font-weight: 800;
}

.miner-search button:hover { background: #350000; }
.miner-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin-bottom: 8px; color: var(--red); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
h1 { max-width: 820px; font-family: 'Cinzel', Georgia, serif; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; }

.wallet-row { max-width: 860px; margin-top: 13px; display: flex; align-items: center; gap: 10px; }
.wallet-address { min-width: 0; overflow: hidden; color: var(--muted); font-family: 'Courier New', monospace; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: .72rem; }
.copy-button:hover { border-color: var(--red-dark); color: var(--text); }

.status-cluster { flex: 0 0 auto; min-width: 172px; padding-top: 8px; text-align: right; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; border: 1px solid var(--green-dark); border-radius: 999px; background: rgba(41, 223, 104, .08); color: var(--green); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(41, 223, 104, .8); }
.status-pill.resting, .inline-status.resting { color: var(--orange); }
.status-pill.resting { border-color: #5d390e; background: rgba(247, 147, 26, .08); }
.status-pill.resting .status-dot { background: var(--orange); box-shadow: 0 0 10px rgba(247, 147, 26, .65); }
.status-pill.offline, .inline-status.offline { color: var(--muted); }
.status-pill.offline { border-color: var(--line); background: rgba(120, 120, 120, .08); }
.status-pill.offline .status-dot { background: var(--muted); box-shadow: none; }

.loading-state, .empty-state {
    display: grid;
    min-height: 450px;
    place-items: center;
    padding: 48px 20px;
    background: rgba(0, 0, 0, .84);
    text-align: center;
}

.empty-state[hidden], .profile-content[hidden], .loading-state[hidden] { display: none; }
.empty-state-inner { width: min(620px, 100%); }
.empty-state h1 { margin: 0 auto 14px; font-size: clamp(1.8rem, 5vw, 3rem); }
.empty-state p { color: var(--muted); line-height: 1.7; }
.empty-state .miner-search { margin: 28px auto 0; text-align: left; }
.loading-state { color: var(--muted); font-size: .85rem; }

.metrics-strip {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(4, 4, 4, .97);
}

.metric { min-width: 0; min-height: 118px; padding: 21px 19px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { margin-bottom: 13px; color: var(--muted-2); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.metric-value { overflow: hidden; color: var(--text); font-family: 'Courier New', monospace; font-size: clamp(1.08rem, 1.7vw, 1.55rem); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.metric-value.green { color: var(--green); }
.metric-value.red { color: var(--red); }
.metric-value.orange { color: var(--orange); }
.metric-note { margin-top: 7px; color: var(--muted-2); font-size: .69rem; }

.content-shell { position: relative; z-index: 2; width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 72px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { font-family: 'Cinzel', Georgia, serif; font-size: 1.35rem; }
.section-heading p { color: var(--muted-2); font-size: .76rem; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(6, 6, 6, .97); }
.chart-panel { margin-bottom: 26px; }

.chart-toolbar { min-height: 64px; padding: 13px 16px 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.chart-summary { display: flex; align-items: baseline; gap: 11px; }
.chart-summary strong { color: var(--green); font-family: 'Courier New', monospace; font-size: 1.25rem; }
.chart-summary span { color: var(--muted-2); font-size: .72rem; }
.range-tabs { display: inline-grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 5px; }
.range-tab { min-width: 82px; height: 34px; padding: 0 11px; border: 0; border-right: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; }
.range-tab:last-child { border-right: 0; }
.range-tab.active { background: #2a0000; color: var(--red); }
.chart-wrap { position: relative; width: 100%; height: 320px; padding: 22px 20px 12px; }
#hashChart { width: 100%; height: 100%; display: block; }
.chart-grid { stroke: #222; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#areaFill); opacity: .45; }
.chart-point { fill: var(--green); stroke: #001508; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-label { fill: #747474; font: 11px 'Inter', Arial, sans-serif; }
.chart-foot { padding: 10px 20px 14px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted-2); font-size: .7rem; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 26px; align-items: start; }
.lower-grid > * { min-width: 0; }
.panel-title { min-height: 57px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-title h3 { font-family: 'Cinzel', Georgia, serif; font-size: .98rem; }
.panel-title span { color: var(--muted-2); font-size: .72rem; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #1c1c1c; text-align: right; vertical-align: middle; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted-2); font-size: .67rem; font-weight: 700; text-transform: uppercase; }
td { color: #d7d7d7; font-size: .78rem; }
td.mono { font-family: 'Courier New', monospace; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.worker-name strong { display: block; color: var(--text); }
.worker-name span { display: block; max-width: 270px; margin-top: 4px; overflow-wrap: anywhere; color: var(--muted-2); font: .68rem 'Courier New', monospace; }
.inline-status { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; }
.inline-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.right-stack { display: grid; gap: 26px; }
.pack-body { padding: 18px; }
.pack-name { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.pack-name strong { font-size: .93rem; }
.pack-badge { padding: 5px 8px; border: 1px solid var(--line-red); border-radius: 4px; color: var(--red); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.contribution-number { margin-bottom: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.contribution-number strong { color: var(--red); font-family: 'Courier New', monospace; font-size: 1.55rem; }
.contribution-number span { color: var(--muted-2); font-size: .71rem; }
.progress { height: 8px; overflow: hidden; border-radius: 4px; background: #1d1d1d; }
.progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--red-dark), var(--red)); }
.pack-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.pack-stat { min-width: 0; padding: 13px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pack-stat span { display: block; color: var(--muted-2); font-size: .66rem; }
.pack-stat strong { display: block; margin-top: 5px; overflow: hidden; font: 700 .85rem 'Courier New', monospace; text-overflow: ellipsis; white-space: nowrap; }
.fairness-note { margin-top: 16px; color: var(--muted); font-size: .71rem; line-height: 1.6; }

.eligibility-row { padding: 15px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); }
.eligibility-row:last-child { border-bottom: 0; }
.check { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--green-dark); border-radius: 50%; background: rgba(41, 223, 104, .08); color: var(--green); font-size: .73rem; font-weight: 800; }
.eligibility-row.failed .check { border-color: #5d390e; background: rgba(247, 147, 26, .08); color: var(--orange); }
.eligibility-row strong { display: block; font-size: .78rem; }
.eligibility-row span { display: block; margin-top: 4px; color: var(--muted-2); font-size: .68rem; line-height: 1.45; }

.timeline { padding: 2px 18px; }
.event { position: relative; padding: 17px 0 17px 22px; border-bottom: 1px solid #1b1b1b; }
.event:last-child { border-bottom: 0; }
.event::before { content: ''; position: absolute; left: 0; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(255, 26, 26, .5); }
.event strong { display: block; font-size: .76rem; }
.event span { display: block; margin-top: 4px; color: var(--muted-2); font-size: .68rem; line-height: 1.45; }
.empty-block { padding: 25px 18px; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.empty-block strong { display: block; margin-bottom: 5px; color: var(--text); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(360px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid var(--line-red); border-radius: 6px; background: #170202; color: var(--text); font-size: .77rem; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

footer { position: relative; z-index: 2; border-top: 1px solid var(--line); background: #020202; }
.footer-inner { width: min(1320px, calc(100% - 40px)); min-height: 78px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted-2); font-size: .7rem; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--red); }

@media (max-width: 1050px) {
    .metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric:nth-child(3) { border-right: 0; }
    .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .lower-grid { grid-template-columns: 1fr; }
    .right-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .right-stack .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .nav-inner, .identity-shell, .content-shell, .footer-inner { width: min(100% - 26px, 1320px); }
    .nav-links a:not([aria-current="page"]) { display: none; }
    .top-tools { grid-template-columns: 1fr; gap: 16px; margin-bottom: 26px; }
    .miner-heading { display: block; }
    .status-cluster { min-width: 0; margin-top: 22px; text-align: left; }
    .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric, .metric:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .metric:nth-child(even) { border-right: 0; }
    .metric:nth-last-child(-n+2) { border-bottom: 0; }
    .chart-toolbar { align-items: flex-start; flex-direction: column; }
    .range-tabs { width: 100%; }
    .range-tab { min-width: 0; }
    .chart-wrap { height: 265px; padding-inline: 10px; }
    .chart-foot { flex-direction: column; gap: 5px; }
    .right-stack { grid-template-columns: 1fr; }
    .right-stack .panel:last-child { grid-column: auto; }
    .footer-inner { padding: 18px 0; align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
    .site-nav, .nav-inner { min-height: 60px; }
    .brand img { width: 32px; height: 32px; }
    .brand-name { font-size: .82rem; }
    .nav-links { gap: 10px; }
    .nav-links a { font-size: .7rem; }
    .identity-shell { padding-top: 24px; }
    .miner-search { grid-template-columns: 1fr; }
    .miner-search button { min-height: 40px; border-top: 1px solid var(--line-red); border-left: 0; }
    .wallet-row { align-items: flex-start; }
    .wallet-address { white-space: normal; overflow-wrap: anywhere; }
    .metrics-strip { grid-template-columns: 1fr; }
    .metric, .metric:nth-child(even), .metric:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
    .metric:last-child { border-bottom: 0; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .pack-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .page-hash-rain { display: none; }
    * { scroll-behavior: auto !important; transition: none !important; }
}
