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

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #0a0a0f;
    --surface: #111118;
    --border: #1e1e2e;
    --accent: #f7931a;
    --accent2: #e55a00;
    --dim: #3a3a55;
    --muted: #7878a0;
    --text: #e8e8f0;
    --subtle: #9898b8;
    --hit: #22c55e;
    --miss: #334155;
    --mono: 'Space Mono', monospace;
    --sans: 'Inter', sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    padding: 0 0 60px;
}

.hero {
    padding: 64px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(247, 147, 26, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero h1 {
    font-family: var(--mono);
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero h1 span {
    color: var(--accent);
}

.hero-sub {
    font-size: 16px;
    color: var(--subtle);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.status-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 24px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.odds-strip {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    margin: 0 auto 40px;
    max-width: 860px;
}

.odds-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px 28px;
    flex: 1 1 180px;
}

.odds-card:first-child {
    border-radius: 8px 0 0 8px;
}

.odds-card:last-child {
    border-radius: 0 8px 8px 0;
}

.odds-card+.odds-card {
    border-left: none;
}

.odds-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    font-family: var(--mono);
}

.odds-value {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
}

.odds-value.white {
    color: var(--text);
}

.context-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 20px 24px;
    margin-bottom: 40px;
    font-size: 13px;
    color: var(--subtle);
    line-height: 1.8;
}

.context-box p+p {
    margin-top: 10px;
}

.context-box strong {
    color: var(--text);
}

.section-title {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.universe-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 40px;
}

.animation-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.universe-desc {
    font-size: 13px;
    color: var(--subtle);
    margin-bottom: 16px;
    line-height: 1.6;
}

.universe-desc strong {
    color: var(--accent);
}

#dot-grid {
    display: grid;
    grid-template-columns: repeat(100, 6px);
    gap: 2px;
    overflow: hidden;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--miss);
    transition: background 0.3s;
}

.dot.hit {
    background: var(--hit);
}

.universe-legend {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.stats-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 18px;
    flex: 1 1 120px;
}

.stat-pill:first-child {
    border-radius: 6px 0 0 6px;
}

.stat-pill:last-child {
    border-radius: 0 6px 6px 0;
}

.stat-pill+.stat-pill {
    border-left: none;
}

.stat-pill-label {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-pill-val {
    font-family: var(--mono);
    font-size: 15px;
    color: var(--text);
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn {
    font-family: var(--mono);
    font-size: 13px;
    padding: 10px 22px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.04em;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent2);
}

.btn-primary:disabled {
    background: var(--dim);
    color: var(--muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--subtle);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.speed-label {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

.batch-picker {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.batch-opt {
    font-family: var(--mono);
    font-size: 13px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--subtle);
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.04em;
    min-width: 44px;
}

.batch-opt:last-child {
    border-right: none;
}

.batch-opt:hover {
    color: var(--accent);
    background: rgba(247, 147, 26, 0.06);
}

.batch-opt.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 477px;
    overscroll-behavior: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 12px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #0d0d15;
    padding: 12px 14px;
    text-align: left;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
}

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

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(247, 147, 26, 0.04);
}

tbody tr.found {
    background: rgba(34, 197, 94, 0.08) !important;
}

td {
    padding: 10px 14px;
    vertical-align: middle;
    color: var(--subtle);
}

td.addr {
    color: var(--text);
    font-size: 11px;
}

td.pk {
    color: var(--accent);
    font-size: 10px;
    word-break: break-all;
}

td.bal {
    color: var(--muted);
    text-align: right;
}

td.bal.has-balance {
    color: var(--hit);
    font-weight: 700;
}

td.status {
    text-align: center;
}

.badge {
    display: inline-block;
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-checking {
    background: rgba(247, 147, 26, 0.15);
    color: var(--accent);
}

.badge-miss {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-found {
    background: rgba(34, 197, 94, 0.2);
    color: var(--hit);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.faq-section {
    margin-top: 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item+.faq-item {
    margin-top: 0;
}

.faq-q {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    transition: color 0.15s;
    user-select: none;
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-q::after {
    content: '+';
    font-family: var(--mono);
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform 0.2s;
}

details[open] .faq-q::after {
    transform: rotate(45deg);
}

.faq-q:hover {
    color: var(--accent);
}

.faq-a {
    font-size: 14px;
    color: var(--subtle);
    line-height: 1.75;
    padding: 0 20px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.faq-a strong {
    color: var(--text);
}

.site-footer {
    max-width: 900px;
    margin: 48px auto 0;
    padding: 24px 24px 40px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
    text-align: center;
    border-top: 1px solid var(--border);
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--dim);
    border-radius: 3px;
}

/* ===== Accessibility ===== */

.skip-link {
    position: absolute;
    top: -56px;
    left: 16px;
    z-index: 1000;
    background: var(--accent);
    color: #000;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.15s;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Screen-reader-only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Visible keyboard focus rings */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Explainer Sections ===== */

.explainer-section {
    margin-bottom: 48px;
}

.explainer-intro {
    font-size: 14px;
    color: var(--subtle);
    line-height: 1.8;
    margin-bottom: 24px;
    max-width: 760px;
}

.explainer-steps {
    display: flex;
    flex-direction: column;
}

.explainer-step {
    display: flex;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 4px;
}

.step-num {
    font-family: var(--mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    padding-top: 3px;
}

.step-body {
    flex: 1;
}

.step-body h3 {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.step-body p {
    font-size: 14px;
    color: var(--subtle);
    line-height: 1.8;
}

.step-example {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 12px;
}

.step-label {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.step-example code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    word-break: break-all;
    display: block;
}

.step-note {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-top: 12px;
    line-height: 1.6;
}

.step-note code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--subtle);
}

.step-connector {
    height: 20px;
    display: flex;
    align-items: center;
    padding-left: 34px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 16px;
    user-select: none;
}

.explainer-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--subtle);
    line-height: 1.8;
}

.explainer-note strong {
    color: var(--text);
}

/* Reason cards */

.reason-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.reason-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 22px;
}

.reason-card h3 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.reason-card p {
    font-size: 13px;
    color: var(--subtle);
    line-height: 1.8;
}

/* Scale comparison cards */

.scale-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.scale-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 22px;
}

.scale-card h3 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.scale-card p {
    font-size: 13px;
    color: var(--subtle);
    line-height: 1.8;
}

/* ===== Responsive / Mobile ===== */

/* Dot grid: scale to container width so all 10,000 dots stay visible */
@media (max-width: 860px) {
    #dot-grid {
        grid-template-columns: repeat(100, 1fr);
        gap: 1px;
        overflow: visible;
    }
    .dot {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
}

@media (max-width: 640px) {
    /* Hero */
    .hero {
        padding: 40px 16px 32px;
    }
    .hero-sub {
        font-size: 14px;
        margin-bottom: 20px;
    }

    /* Section padding */
    .section {
        padding: 0 14px;
    }

    /* Odds strip: 2-column grid, shared borders via gap trick */
    .odds-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        background: var(--border);
        border: 1px solid var(--border);
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 24px;
    }
    .odds-card {
        border-radius: 0 !important;
        border: none !important;
        padding: 14px 14px;
    }
    .odds-card + .odds-card {
        border-left: none !important;
    }

    /* Stats bar: 2-column grid */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        background: var(--border);
        border: 1px solid var(--border);
        border-radius: 6px;
        overflow: hidden;
    }
    .stat-pill {
        border-radius: 0 !important;
        border: none !important;
    }
    .stat-pill + .stat-pill {
        border-left: none !important;
    }

    /* Controls: stack vertically */
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .batch-picker {
        overflow-x: auto;
        width: 100%;
    }
    #btn-start,
    #btn-clear {
        width: 100%;
        text-align: center;
    }

    td.addr,
    td.pk {
        font-size: 9px;
        word-break: break-all;
    }

    /* Status bar */
    .status-bar {
        padding: 10px 14px;
        font-size: 11px;
    }

    /* Context box */
    .context-box {
        padding: 16px;
    }

    /* Footer */
    .site-footer {
        padding: 20px 16px 32px;
    }

    /* Explainer sections */
    .reason-grid,
    .scale-cards {
        grid-template-columns: 1fr;
    }

    .explainer-step {
        flex-direction: column;
        gap: 10px;
    }

    .step-num {
        width: auto;
        font-size: 20px;
    }

    .step-connector {
        padding-left: 0;
    }
}
