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

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

:root {
    --bg: #0a0a0c;
    --bg-panel: rgba(12, 12, 16, 0.9);
    --border: rgba(0, 255, 159, 0.2);
    --text: #c0c0c0;
    --text-dim: rgba(0, 255, 159, 0.5);
    --primary: #00ff9f;
    --burn: #ff3366;
    --reward: #ffcc00;
    --lp: #00ccff;
    --glow: 0 0 10px rgba(0, 255, 159, 0.3);
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 13px;
    line-height: 1.5;
}

/* Background */
.bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 159, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 159, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    opacity: 0.15;
    animation: scan 8s linear infinite;
    z-index: 1000;
    pointer-events: none;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ascii-logo {
    font-size: clamp(0.35rem, 1.1vw, 0.65rem);
    line-height: 1.1;
    color: var(--primary);
    text-shadow: var(--glow), 0 0 20px rgba(0, 255, 159, 0.4);
    margin: 0 auto;
    display: inline-block;
    animation: ascii-glow 3s ease-in-out infinite alternate;
}

@keyframes ascii-glow {
    0% { text-shadow: var(--glow), 0 0 20px rgba(0, 255, 159, 0.2); }
    100% { text-shadow: var(--glow), 0 0 30px rgba(0, 255, 159, 0.5); }
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.tag.version {
    color: var(--primary);
}

.tag.status-tag {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
}

.tag.status-tag.bonded {
    color: var(--lp);
    border-color: var(--lp);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

.tag-separator {
    color: var(--border);
}

/* Contract Bar */
.contract-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
}

.contract-prefix {
    color: var(--primary);
    font-size: 0.75rem;
    white-space: nowrap;
}

.contract-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    min-width: 0;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
}

.panel-header {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

/* Metrics */
.metrics-list {
    padding: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 159, 0.05);
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--text-dim);
    font-size: 0.7rem;
}

.metric-value {
    color: var(--primary);
    font-weight: 500;
}

.metric.burn .metric-value { color: var(--burn); }
.metric.reward .metric-value { color: var(--reward); }
.metric.lp .metric-value { color: var(--lp); }

/* Decision Panel */
.decision-panel {
    display: flex;
    flex-direction: column;
}

.decision-core {
    padding: 1.25rem;
    flex: 1;
}

/* Probability Matrix */
.prob-matrix {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.prob-row {
    display: grid;
    grid-template-columns: 70px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

.prob-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: right;
}

.prob-row:nth-child(1) .prob-label { color: var(--burn); }
.prob-row:nth-child(2) .prob-label { color: var(--reward); }
.prob-row:nth-child(3) .prob-label { color: var(--lp); }

.prob-bar-container {
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.prob-bar {
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
}

.prob-bar.burn {
    background: linear-gradient(90deg, rgba(255, 51, 102, 0.3), rgba(255, 51, 102, 0.6));
    border-right: 2px solid var(--burn);
    box-shadow: inset 0 0 10px rgba(255, 51, 102, 0.3);
}

.prob-bar.reward {
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.3), rgba(255, 204, 0, 0.6));
    border-right: 2px solid var(--reward);
    box-shadow: inset 0 0 10px rgba(255, 204, 0, 0.3);
}

.prob-bar.lp {
    background: linear-gradient(90deg, rgba(0, 204, 255, 0.3), rgba(0, 204, 255, 0.6));
    border-right: 2px solid var(--lp);
    box-shadow: inset 0 0 10px rgba(0, 204, 255, 0.3);
}

.prob-percent {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

.prob-row:nth-child(1) .prob-percent { color: var(--burn); }
.prob-row:nth-child(2) .prob-percent { color: var(--reward); }
.prob-row:nth-child(3) .prob-percent { color: var(--lp); }

/* Neural Broadcast */
.neural-broadcast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 180, 180, 0.06);
    border: 1px solid rgba(0, 180, 180, 0.2);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.neural-broadcast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 200, 0.5), transparent);
}

.neural-broadcast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 200, 0.25), transparent);
}

.broadcast-icon {
    color: #5fd4d4;
    font-size: 0.7rem;
    animation: broadcast-pulse 2s ease-in-out infinite;
}

@keyframes broadcast-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.broadcast-label {
    font-size: 0.7rem;
    color: rgba(0, 180, 180, 0.7);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.broadcast-message {
    flex: 1;
    font-size: 0.85rem;
    color: #7de0e0;
    font-style: italic;
    text-shadow: 0 0 10px rgba(0, 200, 200, 0.25);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.neural-broadcast.active {
    border-color: rgba(0, 200, 200, 0.4);
    box-shadow: 0 0 20px rgba(0, 200, 200, 0.1);
    background: rgba(0, 180, 180, 0.1);
}

.neural-broadcast.active .broadcast-icon {
    animation: none;
    opacity: 1;
}

.neural-broadcast.active .broadcast-message {
    text-shadow: 0 0 15px rgba(0, 200, 200, 0.4);
}

.audio-toggle {
    background: transparent;
    border: 1px solid rgba(0, 180, 180, 0.3);
    color: #7de0e0;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.audio-toggle:hover {
    background: rgba(0, 180, 180, 0.2);
    border-color: rgba(0, 200, 200, 0.5);
}

.audio-toggle.muted {
    opacity: 0.5;
    border-color: rgba(255, 100, 100, 0.3);
}

/* Decision Output */
.decision-output {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
}

.output-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.output-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.output-prefix {
    color: var(--primary);
}

.output-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.output-value.burn { color: var(--burn); text-shadow: 0 0 10px rgba(255, 51, 102, 0.5); }
.output-value.reward { color: var(--reward); text-shadow: 0 0 10px rgba(255, 204, 0, 0.5); }
.output-value.lp_lock, .output-value.lp_burn { color: var(--lp); text-shadow: 0 0 10px rgba(0, 204, 255, 0.5); }

.output-cursor {
    color: var(--primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.output-detail {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    padding-left: 1rem;
    min-height: 1.2em;
}

.output-detail.burn { color: var(--burn); }
.output-detail.reward { color: var(--reward); }
.output-detail.lp_lock { color: var(--lp); }

.output-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Processing */
.processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 255, 159, 0.05);
    border: 1px solid var(--primary);
}

.process-text {
    color: var(--primary);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.process-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Execution Path */
.exec-path {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
}

.path-step {
    color: var(--text-dim);
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
}

.path-step.highlight {
    color: var(--primary);
    border-color: var(--primary);
}

.path-step.active-burn { color: var(--burn); border-color: var(--burn); }
.path-step.active-reward { color: var(--reward); border-color: var(--reward); }
.path-step.active-lp { color: var(--lp); border-color: var(--lp); }

.path-arrow {
    color: var(--text-dim);
}

/* Countdown */
.cycle-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
}

.countdown-label {
    color: var(--text-dim);
}

.countdown-value {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.85rem;
    min-width: 50px;
}

/* Status */
.status-list {
    padding: 0.75rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.25rem;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
}

.status-indicator.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.status-indicator.info {
    background: var(--reward);
    box-shadow: 0 0 8px var(--reward);
}

.status-name {
    flex: 1;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.status-state {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.status-state.active {
    color: var(--primary);
}

.status-state.info {
    color: var(--reward);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Links */
.links-list {
    padding: 0.75rem;
}

.link-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

a.link-row:hover {
    background: rgba(0, 255, 159, 0.05);
}

a.link-row:hover .link-value {
    color: var(--primary);
}

.link-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.link-value {
    font-size: 0.75rem;
    color: var(--text);
}

/* About */
.about-panel {
    margin-bottom: 1rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
}

.about-left {
    padding-right: 1rem;
}

.about-right {
    border-left: 1px solid var(--border);
    padding-left: 1.5rem;
}

.about-block p {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-block p:last-child {
    margin-bottom: 0;
}

.about-highlight {
    color: var(--primary) !important;
    font-weight: 500;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: rgba(0, 255, 159, 0.05);
    text-align: center;
    margin-top: 1.25rem !important;
}

.hl { color: var(--primary); font-weight: 500; }
.hl-burn { color: var(--burn); font-weight: 500; }
.hl-reward { color: var(--reward); font-weight: 500; }
.hl-lp { color: var(--lp); font-weight: 500; }

.mech-title {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.mech-item {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.mech-item:last-child {
    margin-bottom: 0;
}

.arrow {
    color: var(--primary);
    margin-right: 0.5rem;
}

.post-bond-only {
    font-size: 0.65rem;
    color: var(--lp);
    opacity: 0.7;
}

/* Transaction Table */
.table-wrap {
    overflow-x: auto;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
}

.tx-table th {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--primary);
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 255, 159, 0.03);
}

.tx-table td {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 255, 159, 0.05);
    color: var(--text-dim);
}

.tx-table tbody tr:hover {
    background: rgba(0, 255, 159, 0.02);
}

.empty-row {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-dim);
}

.tx-count {
    float: right;
    background: rgba(0, 255, 159, 0.1);
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
}

/* Transaction Types */
.tx-type {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    border: 1px solid;
}

.tx-type-claim { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }
.tx-type-buyback { color: var(--primary); border-color: var(--border); }
.tx-type-burn { color: var(--burn); border-color: rgba(255, 51, 102, 0.3); }
.tx-type-reward { color: var(--reward); border-color: rgba(255, 204, 0, 0.3); }
.tx-type-lp_lock, .tx-type-lp_add { color: var(--lp); border-color: rgba(0, 204, 255, 0.3); }
.tx-type-lp_burn { color: var(--burn); border-color: rgba(255, 51, 102, 0.3); }

.tx-status-success { color: var(--primary); }
.tx-status-failed { color: var(--burn); }

.tx-sig {
    color: #a78bfa;
    text-decoration: none;
}

.tx-sig:hover {
    color: var(--primary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.75rem;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
}

/* Footer */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.footer-sep {
    color: var(--border);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1000px) {
    .main-layout {
        grid-template-columns: 1fr 1fr;
    }

    .main-layout > .panel:nth-child(2) {
        grid-column: span 2;
        order: -1;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-left {
        padding-right: 0;
    }

    .about-right {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 1.25rem;
    }

    .ascii-logo {
        font-size: clamp(0.3rem, 1.5vw, 0.5rem);
    }
}

@media (max-width: 700px) {
    .container {
        padding: 1rem;
    }

    .main-layout {
        grid-template-columns: 1fr;
    }

    .main-layout > .panel:nth-child(2) {
        grid-column: auto;
    }

    .prob-row {
        grid-template-columns: 60px 1fr 40px;
    }

    .exec-path {
        flex-wrap: wrap;
    }

    .header-row {
        gap: 0.5rem;
    }

    .tag {
        font-size: 0.6rem;
    }

    .ascii-logo {
        font-size: clamp(0.25rem, 2vw, 0.4rem);
        overflow-x: auto;
    }

    .header-subtitle {
        font-size: 0.65rem;
    }
}
