/* ── Prisma Track Record — Design System v2 ── */

/* ─ Tokens ─ */
:root {
    --bg-void:    #06080d;
    --bg-base:    #0a0e17;
    --bg-raised:  #111827;
    --bg-surface: #1a2332;
    --border:     rgba(99,102,241,.12);
    --border-dim: rgba(255,255,255,.06);

    --indigo:     #6366f1;
    --cyan:       #06b6d4;
    --emerald:    #10b981;
    --rose:       #f43f5e;
    --amber:      #f59e0b;

    --grad-brand: linear-gradient(135deg, #6366f1, #06b6d4);
    --grad-glow:  linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.08));

    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
}

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

html { scroll-behavior:smooth; }

body {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ─ Ambient Canvas ─ */
#ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: .4;
}

/* ─ Top Bar ─ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    height: 56px;
    background: rgba(10,14,23,.82);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid var(--border-dim);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.prisma-mark {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 1.5px;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-label {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: -2px;
}

.topbar-nav {
    display: flex;
    gap: 4px;
    margin-left: 24px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color .2s, background .2s;
    position: relative;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,.04); }

.tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--grad-brand);
    border-radius: 2px;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--emerald); }
    50%      { opacity: .5; box-shadow: 0 0 10px var(--emerald); }
}

.topbar-org { color: var(--text-secondary); font-weight: 500; }

.topbar-env {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--amber);
    background: rgba(245,158,11,.1);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .5px;
}

/* ─ Mobile Tabs ─ */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10,14,23,.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-dim);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    justify-content: space-around;
}

.mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    transition: color .2s;
}

.mob-tab.active { color: var(--cyan); }

/* ─ Main Wrap ─ */
.main-wrap {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 28px 80px;
}

/* ─ Views ─ */
.view { display: none; animation: fadeIn .35s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════ HERO STRIP ═══════════════ */
.hero-strip {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-glow);
    pointer-events: none;
}

.hero-metric {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.hero-value {
    display: block;
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

.hero-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.hero-divider {
    width: 1px;
    height: 56px;
    background: var(--border);
    flex-shrink: 0;
}

.accent-green { color: var(--emerald); }

/* ═══════════════ SPARKLINE ROW ═══════════════ */
.sparkline-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.sparkline-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.sparkline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sparkline-head h3 {
    font-size: 14px;
    font-weight: 600;
}

.sparkline-badge {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(16,185,129,.12);
}

/* ═══════════════ TABLE ═══════════════ */
.table-section {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-head h3 {
    font-size: 15px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-select {
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--sans);
    cursor: pointer;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--indigo);
    color: var(--indigo);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn-ghost:hover {
    background: var(--indigo);
    color: #fff;
}

.table-scroll { overflow-x: auto; }

.sig-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.sig-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,.15);
}

.sig-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-dim);
    vertical-align: middle;
}

.sig-table tbody tr {
    transition: background .15s;
}

.sig-table tbody tr:hover {
    background: rgba(99,102,241,.04);
}

/* Table badges */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
}

.pill-win     { background: rgba(16,185,129,.12); color: var(--emerald); }
.pill-loss    { background: rgba(244,63,94,.12);  color: var(--rose); }
.pill-pending { background: rgba(245,158,11,.12); color: var(--amber); }
.pill-verified { background: rgba(6,182,212,.1); color: var(--cyan); }

.hash-link {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--indigo);
    opacity: .85;
}

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

.match-league {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.clv-pos { color: var(--emerald); font-family: var(--mono); font-weight: 600; }
.clv-neg { color: var(--rose); font-family: var(--mono); font-weight: 600; }

.passport-btn {
    background: rgba(99,102,241,.08);
    border: 1px solid rgba(99,102,241,.2);
    color: var(--indigo);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: all .2s;
}

.passport-btn:hover {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}

/* ═══════════════ SIGNALS VIEW (PASSPORT GRID) ═══════════════ */
.section-header {
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.section-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.passport-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.passport-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color .25s, transform .25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.passport-card:hover {
    border-color: rgba(99,102,241,.35);
    transform: translateY(-2px);
}

.passport-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-brand);
    opacity: 0;
    transition: opacity .25s;
}

.passport-card:hover::after { opacity: 1; }

.pp-fixture {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}

.pp-league {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pp-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
    color: var(--text-secondary);
}

.pp-row span:last-child { color: var(--text-primary); font-weight: 500; }

.pp-hash {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-dim);
    word-break: break-all;
}

/* ═══════════════ PUBLIC VIEW ═══════════════ */
.public-page {
    max-width: 780px;
    margin: 0 auto;
}

.public-hero {
    text-align: center;
    margin-bottom: 28px;
}

.public-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(6,182,212,.08);
    border: 1px solid rgba(6,182,212,.2);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: .5px;
}

.public-hero h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}

.public-hero p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.public-disclaimer {
    background: rgba(245,158,11,.06);
    border: 1px solid rgba(245,158,11,.15);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.public-signal {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.public-signal-info { flex: 1; }

.public-signal-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.public-signal-info small {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ═══════════════ INTEGRATIONS ═══════════════ */
.integ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.integ-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color .25s;
}

.integ-card:hover { border-color: rgba(99,102,241,.3); }

.integ-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.tg-icon { background: rgba(6,182,212,.1); color: var(--cyan); }
.csv-icon { background: rgba(16,185,129,.1); color: var(--emerald); }
.api-icon { background: rgba(99,102,241,.1); color: var(--indigo); }

.integ-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.integ-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.integ-code {
    display: block;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--cyan);
    background: rgba(6,182,212,.06);
    border: 1px solid rgba(6,182,212,.12);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.integ-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-base);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border-left: 3px solid var(--cyan);
}

.integ-status {
    font-size: 11px;
    font-weight: 600;
    color: var(--emerald);
}

.integ-status.soon { color: var(--text-muted); }

/* ═══════════════ MODALS ═══════════════ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.overlay.active { display: flex; }

.modal-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 520px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.passport-modal { width: 560px; }

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-top h3 { font-size: 17px; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color .15s;
}

.modal-close:hover { color: var(--text-primary); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
}

.field input,
.field select {
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 13px;
    transition: border-color .2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--indigo);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: background .15s;
}

.btn-outline:hover { background: rgba(255,255,255,.04); }

.btn-accent {
    background: var(--grad-brand);
    border: none;
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--sans);
    cursor: pointer;
    transition: opacity .15s;
}

.btn-accent:hover { opacity: .9; }

/* ── Passport modal body ── */
.passport-body-inner {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 2;
}

.passport-body-inner .pp-field {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.passport-body-inner .pp-field .pp-key {
    color: var(--text-muted);
}

.passport-body-inner .pp-field .pp-val {
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.passport-body-inner .pp-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.pp-immutable-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--emerald);
    font-weight: 600;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 900px) {
    .hero-strip {
        flex-direction: column;
        gap: 20px;
        padding: 24px;
    }
    .hero-divider {
        width: 80%;
        height: 1px;
    }
    .sparkline-row {
        grid-template-columns: 1fr;
    }
    .topbar-nav { display: none; }
    .mobile-tabs { display: flex; }
    .main-wrap { padding: 20px 16px 100px; }
    .table-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .hero-value { font-size: 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .passport-grid { grid-template-columns: 1fr; }
}
