:root {
    --bg: #0b0e14;
    --panel: #131722;
    --panel-hover: #171c29;
    --border: #232735;
    --text: #d1d4dc;
    --text-dim: #787b86;
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --gold: #f0b90b;
    --gold-dark: #cf9d05;
    --blue: #3b82f6;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(34, 197, 94, 0.06), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(240, 185, 11, 0.05), transparent 35%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ticker strip */
.ticker-strip {
    background: #05070c;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
    padding: 8px 0;
}

.ticker-track {
    display: inline-flex;
    animation: scroll-ticker 32s linear infinite;
}

@keyframes scroll-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ticker-item {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-right: 32px;
    letter-spacing: 0.3px;
}

.ticker-item strong {
    color: var(--text);
    font-weight: 600;
    margin: 0 4px;
}

.ticker-item.up { color: var(--green); }
.ticker-item.down { color: var(--red); }

/* Header */
.site-header {
    background: linear-gradient(180deg, #0f1420, #0b0e14);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-text {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.logo-text span { color: var(--gold); }

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 22px;
    font-size: 0.92rem;
    transition: color 0.15s;
}

nav a:first-child { margin-left: 0; }
nav a:hover { color: var(--text); }

nav .nav-btn {
    background: var(--gold);
    color: #0b0e14;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 0 0 rgba(240, 185, 11, 0);
    transition: box-shadow 0.2s, background 0.2s;
}

nav .nav-btn:hover {
    background: #ffc61a;
    box-shadow: 0 0 16px rgba(240, 185, 11, 0.35);
    color: #0b0e14;
}

.nav-user {
    color: var(--green);
    font-size: 0.86rem;
    margin-left: 20px;
    font-family: 'Consolas', monospace;
}

.logout-form {
    display: inline-flex;
    margin-left: 14px;
}

.nav-logout {
    background: transparent;
    color: var(--text-dim);
    font-size: 0.86rem;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.nav-logout:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.posting-as {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.posting-as .gold {
    color: var(--gold);
    font-weight: 600;
}

/* Auth pages (login/signup) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 10%, rgba(34, 197, 94, 0.08), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(240, 185, 11, 0.06), transparent 40%);
    padding: 20px;
}

.auth-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}

.auth-logo .gold { color: var(--gold); }

.auth-box h1 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.auth-tagline {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-bottom: 22px;
}

.auth-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.auth-btn {
    width: 100%;
    margin-top: 6px;
}

.auth-switch {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }

main.container {
    padding: 44px 20px 70px;
    min-height: 55vh;
}

/* Page header */
.page-header {
    margin-bottom: 30px;
}

.eyebrow {
    display: inline-block;
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.page-header h1 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-dim);
}

.back-link {
    display: inline-block;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.back-link:hover { text-decoration: underline; }

/* Category cards */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.category-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 22px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.category-card:hover {
    border-color: var(--green);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px var(--green-glow);
    background: var(--panel-hover);
}

.category-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.category-icon {
    font-size: 1.5rem;
}

.category-card h2 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.category-card p {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-bottom: 14px;
}

.topic-count {
    display: inline-block;
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: 'Consolas', monospace;
}

.card-cta {
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Topic list (order-book style) */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 26px;
}

.topic-row {
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    overflow: hidden;
}

.topic-row:hover {
    border-color: var(--gold);
    background: var(--panel-hover);
}

.topic-row-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--green);
}

.topic-row-main {
    flex: 1;
    padding-left: 12px;
}

.topic-row h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.topic-meta {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.author-tag {
    color: var(--blue);
}

.reply-badge {
    background: rgba(240, 185, 11, 0.12);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: 12px;
    font-family: 'Consolas', monospace;
}

.empty-state {
    color: var(--text-dim);
    padding: 26px;
    text-align: center;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--gold);
    color: #0b0e14;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}

.btn:hover {
    background: #ffc61a;
    box-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
    transform: translateY(-1px);
}

/* Posts (topic + replies) */
.post {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 26px;
    margin-bottom: 16px;
}

.original-post {
    border-left: 3px solid var(--green);
    box-shadow: 0 0 0 1px var(--green-glow), 0 8px 24px rgba(0,0,0,0.3);
}

.reply-post {
    border-left: 3px solid var(--blue);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.post-author {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #fff;
}

.avatar-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 8px;
    box-shadow: 0 0 8px var(--green);
}

.post-date {
    color: var(--text-dim);
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
}

.topic-title {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 14px;
    letter-spacing: -0.4px;
}

.post-body {
    color: var(--text);
}

.replies-heading {
    font-size: 1.05rem;
    color: #fff;
    margin: 26px 0 14px;
    font-weight: 600;
}

.reply-list {
    margin-bottom: 30px;
}

.reply-form-box,
.new-topic-form {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
}

.new-topic-form { max-width: 600px; }

.reply-form-box h3 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1.02rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.88rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #0e1219;
    color: var(--text);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #4b5061;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.12);
}

.field-error {
    color: var(--red);
    font-size: 0.85rem;
    margin-top: 4px;
}

.site-footer {
    background: #05070c;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    text-align: center;
    padding: 22px 0;
    font-size: 0.82rem;
}
