/* ═══════════════════════════════════════════════════════════
   Arbitrage Pro Design System
   Dark-mode financial interface with sharp, editorial feel
   ═══════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─── */
:root {
    /* Surfaces */
    --bg-root: #0a0b0e;
    --bg-surface: #111318;
    --bg-elevated: #181b22;
    --bg-card: #14161c;
    --bg-card-hover: #1a1d25;
    --bg-input: #111318;
    --bg-overlay: rgba(0,0,0,0.6);

    /* Borders */
    --border-subtle: rgba(255,255,255,0.06);
    --border-default: rgba(255,255,255,0.1);
    --border-strong: rgba(255,255,255,0.18);

    /* Text */
    --text-primary: #f0f0f2;
    --text-secondary: #9a9cae;
    --text-tertiary: #5e6073;
    --text-inverse: #0a0b0e;

    /* Accent — cool blue */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-muted: rgba(59,130,246,0.12);
    --accent-subtle: rgba(59,130,246,0.06);

    /* Semantic */
    --green: #22c55e;
    --green-muted: rgba(34,197,94,0.12);
    --red: #ef4444;
    --red-muted: rgba(239,68,68,0.12);
    --blue: #3b82f6;
    --blue-muted: rgba(59,130,246,0.12);
    --purple: #8b5cf6;
    --purple-muted: rgba(139,92,246,0.12);
    --teal: #14b8a6;
    --teal-muted: rgba(20,184,166,0.12);

    /* Typography */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(59,130,246,0.15);

    /* Transitions */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.2s;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ─── Background Texture ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249,115,22,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139,92,246,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Navigation ─── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,11,14,0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
}

.nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 64px;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.nav__logo {
    display: flex;
}

.nav__wordmark {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.nav__wordmark--accent {
    color: var(--accent);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-left: var(--space-lg);
}

.nav__link {
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}

.nav__link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav__link--active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav__link--subtle {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.nav__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav__user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
}

.nav__user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav__mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
}

/* ─── Main ─── */
.main {
    flex: 1;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-2xl) 0;
}

/* ─── Footer ─── */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-lg) 0;
    position: relative;
    z-index: 1;
}

.footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer__brand {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer__copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: var(--space-md);
}

.footer__status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 500;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    text-decoration: none;
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn--md {
    padding: 10px 22px;
}

.btn--lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn--primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn--primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

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

.btn--ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn--danger {
    background: var(--red-muted);
    color: var(--red);
}

.btn--success {
    background: var(--green-muted);
    color: var(--green);
}

.btn--success:hover {
    background: rgba(34,197,94,0.2);
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s var(--ease);
}

.card:hover {
    border-color: var(--border-default);
}

.card--elevated {
    background: var(--bg-elevated);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─── Stat Cards ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all 0.3s var(--ease);
}

.stat-card:hover {
    border-color: var(--border-default);
    transform: translateY(-1px);
}

.stat-card__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-sm);
}

.stat-card__value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card__value--green { color: var(--green); }
.stat-card__value--accent { color: var(--accent); }
.stat-card__value--blue { color: var(--blue); }
.stat-card__value--purple { color: var(--purple); }

.stat-card__sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* ─── Opportunity Cards ─── */
.opp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.opp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: 3px 0 0 3px;
}

.opp-card--high::before { background: var(--green); }
.opp-card--medium::before { background: var(--teal); }
.opp-card--low::before { background: var(--text-tertiary); }

.opp-card:hover {
    border-color: var(--border-default);
    background: var(--bg-card-hover);
}

.opp-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.opp-card__event {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.opp-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
    flex-wrap: wrap;
}

.opp-card__roi {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--green);
    flex-shrink: 0;
}

.opp-card__legs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.opp-leg {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.opp-leg__platform {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.opp-leg__icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
}

.opp-leg__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.opp-leg__type {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.opp-leg__side {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.opp-leg__odds {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
}

.opp-leg__detail {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.opp-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.opp-card__info-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ─── Tags / Badges ─── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.tag--live {
    background: var(--green-muted);
    color: var(--green);
}

.tag--expired {
    background: rgba(255,255,255,0.05);
    color: var(--text-tertiary);
}

.tag--executed {
    background: var(--blue-muted);
    color: var(--blue);
}

.tag--missed {
    background: var(--red-muted);
    color: var(--red);
}

.tag--high {
    background: var(--green-muted);
    color: var(--green);
}

.tag--medium {
    background: var(--teal-muted);
    color: var(--teal);
}

.tag--low {
    background: rgba(255,255,255,0.05);
    color: var(--text-tertiary);
}

.tag--pm {
    background: var(--purple-muted);
    color: var(--purple);
}

.tag--sb {
    background: var(--green-muted);
    color: var(--green);
}

.tag--type {
    background: var(--accent-muted);
    color: var(--accent);
}

.tag--ingame {
    background: var(--red-muted);
    color: var(--red);
    animation: pulse-tag 2s ease-in-out infinite;
}

@keyframes pulse-tag {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── Pulse Dot ─── */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* ─── Tables ─── */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

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

thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
    white-space: nowrap;
}

tbody td {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

tbody tr {
    transition: background var(--duration) var(--ease);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

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

.td-mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
}

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

/* ─── Forms ─── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: all var(--duration) var(--ease);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-error {
    background: var(--red-muted);
    color: var(--red);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.form-check label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ─── Balance Bar ─── */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all 0.2s var(--ease);
}

.balance-card:hover {
    border-color: var(--border-default);
}

.balance-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.balance-card__info {
    flex: 1;
    min-width: 0;
}

.balance-card__name {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.balance-card__amount {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

/* ─── Hero Section (Homepage) ─── */
.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
    text-align: center;
    position: relative;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 16px;
    background: var(--accent-muted);
    border: 1px solid rgba(249,115,22,0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-lg);
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero__title span {
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ─── Page Headers ─── */
.page-header {
    padding: var(--space-xl) 0 var(--space-lg);
}

.page-header__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.page-header__sub {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ─── Grid Layouts ─── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.opp-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ─── Section Headers ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-header__title {
    font-size: 1.125rem;
    font-weight: 700;
}

.section-header__action {
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 500;
}

.section-header__action:hover {
    text-decoration: underline;
}

/* ─── Auth Pages ─── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 130px);
    padding: var(--space-xl);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.auth-card__sub {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-xl);
    font-size: 0.9375rem;
}

.auth-card__footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.auth-card__footer a {
    color: var(--accent);
    font-weight: 500;
}

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

/* ─── Chart Placeholder ─── */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.chart-bar-row__label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    width: 160px;
    flex-shrink: 0;
    text-align: right;
}

.chart-bar-row__bar {
    flex: 1;
    height: 28px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-row__fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 1s var(--ease);
}

.chart-bar-row__value {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    width: 60px;
    flex-shrink: 0;
}

/* ─── Mini sparkline chart ─── */
.sparkline-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    align-items: flex-end;
    height: 48px;
}

.sparkline-bar {
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sparkline-bar:hover {
    opacity: 1;
}

/* ─── Toggle ─── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-row__label {
    font-size: 0.9375rem;
    font-weight: 500;
}

.toggle-row__desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

/* ─── Animations ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s var(--ease) both;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .nav__links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        padding: var(--space-md);
        flex-direction: column;
    }

    .nav__links--open {
        display: flex;
    }

    .nav__mobile-toggle {
        display: block;
    }

    .nav__user-name {
        display: none;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .opp-card__legs {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero__title {
        font-size: 2.2rem;
    }

    .footer__inner {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

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

/* ─── Arb Cards ─── */
.arb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}

.arb-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.arb-card--demo {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card), var(--accent-subtle));
}

.arb-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.arb-card__event-name {
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--text-primary);
}

.arb-card__meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.arb-card__roi {
    text-align: right;
}

.arb-card__roi-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green);
}

.arb-card__roi-value.roi-high { color: var(--green); }
.arb-card__roi-value.roi-med { color: var(--teal); }
.arb-card__roi-value.roi-low { color: var(--text-secondary); }

.arb-card__roi-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.arb-card__legs {
    padding: 0;
}

.arb-card__footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.arb-card__profit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.arb-card__profit-row--main {
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
}

.arb-card__actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* ─── Legal Pages ─── */
.page-legal {
    background: var(--bg-primary);
}

.legal-content h2 {
    font-family: var(--font-display);
}

.legal-content ul {
    list-style: disc;
}

.legal-content ul li {
    margin-bottom: 8px;
}

.legal-content p {
    margin-bottom: 16px;
}

/* ─── Footer Enhancements ─── */
.footer__inner {
    flex-wrap: wrap;
    gap: 16px;
}

.footer__center {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
    .footer__center {
        order: 2;
        width: auto;
        padding-top: 0;
        border-top: none;
    }
}

/* ─── Yellow/Warning Colors ─── */
:root {
    --yellow: #eab308;
    --yellow-muted: rgba(234, 179, 8, 0.1);
    --red: #ef4444;
    --red-muted: rgba(239, 68, 68, 0.1);
}

/* ─── Live Game Styles ─── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.arb-card--live {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.arb-card--live .arb-card__header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
}

/* ═══════════════════════════════════════════════════════════
   Mobile Responsive Enhancements
   ═══════════════════════════════════════════════════════════ */

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav__links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        padding: 16px;
        display: none;
        flex-direction: column;
        gap: 8px;
        z-index: 999;
    }
    
    .nav__links--open {
        display: flex;
    }
    
    .nav__link {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        background: var(--bg-elevated);
    }
    
    .nav__mobile-toggle {
        display: flex;
    }
    
    .nav__user-name {
        display: none;
    }
}

/* Mobile Stats Grid */
@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card__value {
        font-size: 1.5rem;
    }
}

/* Mobile Arb Cards */
@media (max-width: 768px) {
    .arb-card {
        border-radius: var(--radius-md);
    }
    
    .arb-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .arb-card__roi {
        align-self: flex-start;
    }
    
    .legs-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .legs-table th,
    .legs-table td {
        min-width: 80px;
        padding: 10px 8px;
        font-size: 0.8125rem;
    }
    
    .th-actions {
        min-width: 140px;
    }
    
    .btn-action {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* Mobile Stake Controls */
@media (max-width: 640px) {
    .stake-preset {
        padding: 8px 10px;
        font-size: 0.6875rem;
    }
    
    .stake-input-global {
        width: 80px;
    }
}

/* Mobile Feature Pills */
@media (max-width: 640px) {
    .feature-pills {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .feature-pill {
        flex-shrink: 0;
        font-size: 0.8125rem;
    }
}

/* Mobile Empty State */
@media (max-width: 640px) {
    .empty-state-enhanced .card {
        padding: 20px;
    }
    
    .empty-state-enhanced h4 {
        font-size: 0.9375rem;
    }
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-card {
    height: 200px;
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text--short {
    width: 60%;
}

/* Touch-friendly targets */
@media (hover: none) {
    .btn {
        min-height: 44px;
    }
    
    .nav__link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .checkbox-label {
        min-height: 44px;
    }
}

/* Improve contrast for accessibility */
.text-secondary {
    color: var(--text-secondary);
}

/* Focus states for keyboard navigation */
.btn:focus-visible,
.nav__link:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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