/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip-to-content link — visible only on keyboard focus */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    z-index: 10000;
    padding: 0.75rem 1.25rem;
    background: #e0115f;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0 0 8px 0;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Accessible focus indicators for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent-primary, #e0115f);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default focus ring for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Suppress transitions during initial page load to prevent nav-link active-state glitch */
html.preload .nav-link {
    transition: none !important;
}

/* Theme Variables */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0b0d;
    --bg-secondary: #14151a;
    --bg-tertiary: #1e1f24;
    --border-color: #2a2b30;
    --border-hover: #3a3b40;
    --text-primary: #e8eaed;
    --text-secondary: #b4b6ba;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-navbar: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-notification: 600;
    --z-toast: 700;
}

body.light-theme {
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --border-color: #dee2e6;
    --border-hover: #ced4da;
    --text-primary: #000000;
    --text-secondary: #666666;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar Styles */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0;
    font-weight: 700;
    cursor: pointer;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    color: #e0115f;
    font-weight: 700;
    font-size: 31.5px;
    line-height: 1;
    letter-spacing: -0.01em;
}

.navbar-links {
    display: flex;
    gap: 4px !important;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 11px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: #2a2c35;
    color: var(--text-primary);
}

body.light-theme .nav-link.active {
    background: #d1d5db;
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.balance {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    min-width: 0;
    transition: background-color 0.3s ease;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.balance-amount {
    color: #4ade80;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.practice-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #78350f;
    background: #fde68a;
    border: 1px solid #fbbf24;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff1f73 0%, #e0115f 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(224, 17, 95, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 17, 95, 0.5);
    background: linear-gradient(135deg, #e0115f 0%, #c00f52 100%);
}

.deposit-btn-nav {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(224, 17, 95, 0.42);
    background: linear-gradient(135deg, #ff1f73 0%, #e0115f 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(224, 17, 95, 0.35);
}

.deposit-btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 17, 95, 0.45);
    background: linear-gradient(135deg, #f3186a 0%, #cd0f56 100%);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* Navbar notifications */
.nav-notifications-wrapper {
    position: relative;
}

.nav-notifications-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-notifications-btn:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
}

.nav-notifications-icon {
    font-size: 16px;
    line-height: 1;
}

.nav-notifications-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

.nav-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    z-index: var(--z-notification);
}

.nav-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.nav-notifications-mark-all {
    border: none;
    background: transparent;
    color: #e0115f;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.nav-notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.nav-notification-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.nav-notification-item:last-child {
    border-bottom: none;
}

.nav-notification-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.nav-notification-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-notification-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.nav-notification-body {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.nav-notifications-empty {
    padding: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.nav-notification-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: min(360px, calc(100vw - 24px));
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: var(--z-toast);
    pointer-events: none;
}

.nav-notification-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Language Toggle */
.language-toggle {
    position: relative;
}

.btn-language {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-language:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: var(--z-dropdown);
    min-width: 150px;
    overflow: hidden;
}

.language-option {
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.language-option:hover {
    background: var(--bg-tertiary);
}

.language-option .flag {
    font-size: 18px;
}

/* Categories Bar */
.categories-bar {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 52px;
    z-index: var(--z-sticky);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.categories-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
}

.category-list {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 20px;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 400;
    padding: 0;
    position: relative;
}

.category-item:hover {
    color: var(--text-primary);
}

.category-item.active {
    color: var(--text-primary);
    font-weight: 700;
}

.category-icon {
    font-size: 16px;
}

.category-name {
    font-size: 14px;
}

.category-count {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-weight: 600;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

@media (max-width: 480px) {
    .app-container {
        padding: 16px;
    }
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

/* Stats centered absolutely within content-header (desktop only) */
.content-header-stats {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 6px;
    max-width: none;
    margin: 0;
    pointer-events: none;
}
.content-header-stats .stats-bar-item,
.content-header-stats .stats-bar-divider {
    pointer-events: auto;
}
@media (max-width: 900px) {
    .content-header-stats {
        position: static;
        transform: none;
        grid-column: 1 / -1;
        margin-top: 12px;
    }
    .content-header {
        flex-wrap: wrap;
    }
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.content-controls {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

@media (max-width: 600px) {
    .content-controls {
        width: 100%;
        padding-top: 8px;
    }
    .sort-select {
        width: 100%;
    }
}

.sort-select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Markets Grid */
.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Market Card */
.market-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.market-card:hover {
    border-color: var(--gradient-start);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.market-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.market-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(20, 21, 26, 0.9));
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
}

.market-category {
    font-size: 12px;
    padding: 4px 12px;
    background: #e0115f;
    border-radius: 12px;
    color: white;
    font-weight: 600;
}

.market-participants {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-title {
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}

.market-description {
    padding: 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.market-probabilities {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.probability-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.probability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.probability-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.probability-value {
    font-size: 14px;
    font-weight: 700;
}

.yes-section .probability-value {
    color: #4ade80;
}

.no-section .probability-value {
    color: #f87171;
}

.probability-bar-container {
    height: 8px;
    background: #1e1f24;
    border-radius: 4px;
    overflow: hidden;
}

.probability-bar {
    height: 100%;
    transition: width 0.3s;
}

.yes-bar {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.no-bar {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.market-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.market-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.market-actions {
    display: flex;
    gap: 8px;
}

.btn-trade {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-yes {
    background: #4ade80;
    color: #0a0b0d;
}

.btn-yes:hover {
    background: #22c55e;
    transform: translateY(-1px);
}

.btn-no {
    background: #f87171;
    color: #0a0b0d;
}

.btn-no:hover {
    background: #ef4444;
    transform: translateY(-1px);
}

.btn-comments {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comments:hover {
    background: var(--border-hover);
}

/* Comment Section */
.comment-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.comment-section-header {
    margin-bottom: 16px;
}

.comment-section-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.comment-form {
    margin-bottom: 20px;
}

.comment-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.comment-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-post-comment {
    padding: 10px 20px;
    background: #667eea;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-post-comment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-post-comment:not(:disabled):hover {
    background: #5568d3;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment {
    display: flex;
    gap: 12px;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.comment-timestamp {
    color: var(--text-secondary);
    font-size: 12px;
}

.comment-text {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 12px;
}

.btn-like,
.btn-reply {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-like:hover,
.btn-reply:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .markets-grid {
        grid-template-columns: 1fr;
    }

    .categories-container {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }

    .navbar-actions {
        gap: 8px;
    }

    .balance {
        display: none;
    }

    .deposit-btn-nav {
        display: none !important;
    }
}

@media (max-width: 1120px) {
    .balance-label {
        display: none;
    }
}

/* Theme Toggle Button */
.btn-theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-theme-toggle:hover {
    background: var(--border-hover);
    transform: rotate(180deg);
}

/* Search and Filters */
.search-filters-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: #e0115f;
    box-shadow: 0 0 0 3px rgba(224, 17, 95, 0.1);
}

.search-icon {
    font-size: 18px;
    margin-right: 12px;
    color: var(--text-secondary);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    background: var(--bg-tertiary);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.search-clear:hover {
    background: var(--border-hover);
    color: var(--text-primary);
}

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

@media (max-width: 600px) {
    .filter-select {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
    }
    .filters-row {
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .filter-select {
        flex: 1 1 100%;
    }
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    outline: none;
    border-color: #e0115f;
}

.btn-reset-filters {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-filters:hover {
    background: var(--border-hover);
    border-color: #e0115f;
    color: #e0115f;
}

/* Market Badges */
.market-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.market-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-hot {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.95) 0%, rgba(249, 115, 22, 0.95) 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.badge-trending {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    color: white;
    animation: bounce 2s ease-in-out infinite;
}

.badge-new {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
    color: white;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.03);
    }
}

/* Update market-card to support badges */
.market-card {
    position: relative;
}

/* ============================================================
   PLATFORM STATS BAR
   ============================================================ */
.stats-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.stats-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-bar-value {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.stats-bar-label {
    font-size: 13.8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-bar-divider {
    display: none;
}

@media (max-width: 480px) {
    .stats-bar-inner { gap: 20px; }
    .stats-bar-value { font-size: 14px; }
    .stats-bar-label { display: none; }
}

/* ============================================================
   SHARE BUTTONS (market cards + market detail)
   ============================================================ */
.market-card-share {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.share-btn-twitter,
.share-btn-copy {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.share-btn-twitter:hover {
    background: #1d9bf0;
    border-color: #1d9bf0;
    color: #fff;
}

.share-btn-copy:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Market-detail share row */
.market-share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.market-share-row .share-btn-twitter,
.market-share-row .share-btn-copy {
    font-size: 13px;
    padding: 7px 14px;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.orny-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #222;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: var(--z-toast);
    pointer-events: none;
    white-space: nowrap;
}
.orny-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   ONBOARDING MODAL
   ============================================================ */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    padding: 16px;
    backdrop-filter: blur(4px);
}

.onboarding-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 32px 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.onboarding-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.onboarding-close:hover { color: var(--text-primary); }

.onboarding-logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.onboarding-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.onboarding-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.onboarding-step-text h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.onboarding-step-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.onboarding-cta {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}
.onboarding-cta:hover { background: #5a6fd6; }

.onboarding-skip {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
}
.onboarding-skip:hover { color: var(--text-primary); }

/* ============================================================
   WIN RATE STAT
   ============================================================ */
#winRate {
    font-size: 24px;
    font-weight: 800;
}

/* ============================================================
   MY RANK CARD (leaderboard)
   ============================================================ */
.my-rank-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(102, 126, 234, 0.04) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
}

.my-rank-card.unranked {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.my-rank-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.my-rank-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667eea;
}

.my-rank-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.my-rank-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.my-rank-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.my-rank-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.my-rank-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.my-rank-stat-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Highlight current user's row in the leaderboard table */
.leaderboard-row.my-row {
    background: rgba(102, 126, 234, 0.08);
    border-left: 3px solid #667eea;
}

/* ============================================================
   MOBILE IMPROVEMENTS
   ============================================================ */

/* Market card share buttons: stack vertically on very small screens */
@media (max-width: 360px) {
    .market-card-share {
        flex-wrap: wrap;
    }
    .share-btn-twitter {
        flex: 1;
        justify-content: center;
    }
}

/* Onboarding modal: tighten on small screens */
@media (max-width: 480px) {
    .onboarding-modal {
        padding: 28px 20px 24px;
    }
    .onboarding-step-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .my-rank-stats {
        gap: 16px;
    }
    .my-rank-card {
        gap: 16px;
    }
}

/* Fix navbar overflow on mobile */
@media (max-width: 640px) {
    .navbar-links {
        display: none;
    }
    .navbar-actions {
        gap: 8px;
    }
}

/* Responsive filters */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
        min-width: auto;
    }

    .search-box {
        padding: 10px 14px;
    }

    .search-input {
        font-size: 14px;
    }
}

/* ============================================
   MOBILE NAVIGATION DRAWER
   ============================================ */

/* Hamburger Button — hidden on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: var(--z-notification);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.2s;
}

/* Mobile Overlay */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: var(--z-modal);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
    display: flex;
    flex-direction: column;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.mobile-nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    overflow-y: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: #e0115f;
}

.mobile-nav-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
}

/* WCAG 2.1 Level A — respect user's motion preference */
@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;
    }
}

/* Mobile Search — hidden on desktop, shown on mobile */
.mobile-search {
    display: none;
}
.mobile-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.mobile-search-input:focus {
    border-color: var(--accent-primary, #e0115f);
}
@media (max-width: 768px) {
    .mobile-search {
        display: block;
        margin-bottom: 12px;
    }
}
