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

:root {
    --bg: #000000;
    --panel: rgba(0, 0, 0, 0.5);
    --panel-2: rgba(11, 11, 11, 0.7);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.65);
    --line: rgba(255, 255, 255, 0.12);
    --line-bright: rgba(255, 255, 255, 0.22);

    --up: #c4ee66;
    --up-bg: #2e4206;
    --down-bg: #250F1E;
    --down: #BA4E85;

    /* Exchange colors */
    --bybit: #f7a600;
    --binance: #ffd700;
    --okx: #c4ee66;
    --bitget: #00d4ff;

    --radius-lg: 12px;
    --radius-md: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    padding: 0;
    color: var(--text);
    letter-spacing: -0.01em;
    position: relative;
    overflow-x: hidden;
}

/* Simple polkadot background - static */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(196, 238, 102, 0.3) 2px, transparent 2px);
    background-size: 45px 45px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

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

.title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-section h1 {
    font-size: 24px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Market Selector */
.market-selector {
    display: flex;
    gap: 6px;
    background: var(--panel-2);
    padding: 3px;
    border-radius: 7px;
    border: 1px solid var(--line);
}

.market-selector button {
    padding: 7px 14px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.market-selector button.active {
    background: var(--up);
    color: var(--bg);
}

/* Exchange Selector */
.exchange-selector {
    display: flex;
    gap: 6px;
    background: var(--panel-2);
    padding: 3px;
    border-radius: 7px;
    border: 1px solid var(--line);
}

.exchange-selector button {
    padding: 7px 14px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    letter-spacing: 0.03em;
}

.exchange-selector button[data-exchange="bybit"].active {
    background: var(--bybit);
    color: var(--bg);
}

.exchange-selector button[data-exchange="binance"].active {
    background: var(--binance);
    color: var(--bg);
}

.exchange-selector button[data-exchange="okx"].active {
    background: var(--okx);
    color: var(--bg);
}

.exchange-selector button[data-exchange="bitget"].active {
    background: var(--bitget);
    color: var(--bg);
}

/* Controls */
.controls-container {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--line);
}

.controls-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-container label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
}

.sort-container select,
.sort-container input {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: inherit;
}

.sort-container select:focus,
.sort-container input:focus {
    outline: none;
    border-color: var(--up);
    background-color: var(--panel);
}

.sort-container input {
    width: 220px;
}

/* Hero */
.hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 14px;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-main {
    flex: 1;
    min-width: 250px;
}

.hero-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.hero-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

/* Fear & Greed Widget */
.fear-greed-widget {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    min-width: 200px;
    max-width: 240px;
}

.fear-greed-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.fear-greed-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1;
}

.fear-greed-text {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.fear-greed-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, 
        #d32f2f 0%, 
        #f57c00 25%, 
        #fdd835 50%, 
        #7cb342 75%, 
        #388e3c 100%
    );
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.fear-greed-indicator {
    position: absolute;
    top: -4px;
    left: 0%;
    width: 4px;
    height: 16px;
    background: white;
    border: 2px solid var(--bg);
    border-radius: 2px;
    transition: left 0.5s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fear-greed-hint {
    font-size: 10px;
    color: var(--muted);
    margin-top: 8px;
    font-weight: 600;
    opacity: 0.7;
}

/* Ticker */
.ticker {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 8px 0;
    margin-bottom: 14px;
    overflow: hidden;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
    will-change: transform;
    padding-left: 14px;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.ticker-symbol {
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.ticker-price {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
}

.ticker-pill {
    padding: 3px 7px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 11px;
}

.ticker-pill.up {
    color: var(--up);
    background: var(--up-bg);
}

.ticker-pill.down {
    color: var(--down);
    background: var(--down-bg);
}

/* News Section */
.news-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    overflow: hidden;
}

.news-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-header h3 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.news-view-all {
    font-size: 12px;
    font-weight: 700;
    color: var(--up);
    text-decoration: none;
    padding: 6px 12px;
    background: var(--up-bg);
    border-radius: 6px;
    transition: all 0.2s;
}

.news-view-all:hover {
    background: var(--up);
    color: var(--bg);
}

.news-scroller {
    overflow: hidden;
    position: relative;
}

.news-track {
    display: flex;
    gap: 12px;
    animation: newsScroll 60s linear infinite;
    will-change: transform;
}

.news-track:hover {
    animation-play-state: paused;
}

.news-item {
    flex-shrink: 0;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 300px;
    max-width: 400px;
    cursor: pointer;
    transition: all 0.2s;
}

.news-item:hover {
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
}

.news-source {
    font-weight: 700;
    text-transform: uppercase;
}

.news-time {
    font-weight: 600;
}

.news-sentiment {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.news-sentiment.positive {
    background: var(--up-bg);
    color: var(--up);
}

.news-sentiment.negative {
    background: var(--down-bg);
    color: var(--down);
}

.news-sentiment.neutral {
    background: var(--panel);
    color: var(--muted);
}

@keyframes newsScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pinned Section */
.pinned-section {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

.pinned-section.empty {
    display: none;
}

.pinned-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.pinned-header h3 {
    font-size: 13px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pinned-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* Price List */
.price-list-section {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

.price-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    min-height: 200px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 16px;
    color: var(--muted);
    font-size: 14px;
}

/* Price Cards */
.price-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: visible;
}

.price-card:hover {
    border-color: var(--line-bright);
    transform: translateY(-2px);
    background: var(--panel-2);
}

.price-card.pinned {
    border-color: var(--up);
}

.pin-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
    color: var(--muted);
}

.pin-btn:hover {
    transform: scale(1.2);
    color: var(--up);
}

.price-card.pinned .pin-btn {
    color: var(--up);
}

.symbol {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.last-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.price-change {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
    display: inline-flex;
    border-radius: 999px;
}

.price-change.positive {
    background: var(--up-bg);
    color: var(--up);
}

.price-change.negative {
    background: var(--down-bg);
    color: var(--down);
}

/* Sparkline */
.sparkline {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 80px;
    height: 32px;
    opacity: 0.7;
    pointer-events: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.pagination button {
    padding: 8px 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-2);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--text);
}

.pagination button:hover:not(:disabled) {
    background: var(--up);
    color: var(--bg);
    border-color: var(--up);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#pageInfo {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

/* Page numbers */
.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-number {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-2);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--text);
    min-width: 40px;
}

.page-number:hover {
    background: var(--up);
    color: var(--bg);
    border-color: var(--up);
}

.page-number.active {
    background: var(--up);
    color: var(--bg);
    border-color: var(--up);
}

.page-ellipsis {
    color: var(--muted);
    font-weight: 600;
    padding: 0 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(145deg, rgba(15, 15, 15, 0.95), rgba(5, 5, 5, 0.98));
    border-radius: 20px;
    padding: 40px;
    max-width: 920px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(196, 238, 102, 0.12);
    box-shadow: 
        0 25px 60px -12px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 26px;
    font-weight: 300;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
    background: rgba(196, 238, 102, 0.12);
    border-color: rgba(196, 238, 102, 0.3);
    color: var(--okx);
    transform: scale(1.05);
}

.modal-header {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-symbol {
    font-size: 38px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-exchange {
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-price {
    font-size: 56px;
    font-weight: 900;
    margin: 20px 0;
    color: var(--text);
    letter-spacing: -0.04em;
    text-shadow: 0 2px 20px rgba(196, 238, 102, 0.15);
}

.modal-change {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 32px;
    padding: 10px 18px;
    display: inline-flex;
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid;
    transition: all 0.2s;
}

.modal-change.positive {
    background: rgba(46, 66, 6, 0.5);
    color: var(--up);
    border-color: rgba(196, 238, 102, 0.3);
    box-shadow: 0 4px 12px rgba(196, 238, 102, 0.15);
}

.modal-change.negative {
    background: rgba(37, 15, 30, 0.5);
    color: var(--down);
    border-color: rgba(186, 78, 133, 0.3);
    box-shadow: 0 4px 12px rgba(186, 78, 133, 0.15);
}

.price-range-container {
    margin: 24px 0;
}

.price-range-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.timeframe-selector {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.timeframe-btn {
    padding: 7px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    color: var(--text);
}

.timeframe-btn:hover {
    background: var(--panel);
}

.timeframe-btn.active {
    background: var(--up);
    color: var(--bg);
    border-color: var(--up);
}

#chartInfo {
    text-align: center;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 16px;
    background-color: var(--panel-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.chart-tooltip {
    position: absolute;
    display: none;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.95);
    color: var(--text);
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid var(--line);
}

.chart-tooltip div {
    margin: 2px 0;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    margin: 24px 0;
    gap: 12px;
}

.price-label {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--panel-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.price-label-title {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.price-label-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

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

.stat-item {
    background: var(--panel-2);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 16px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .title-section h1 {
        font-size: 20px;
    }
    
    .controls-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .controls-left {
        flex-direction: column;
    }
    
    .sort-container input {
        width: 100%;
    }
    
    .price-list,
    .pinned-list {
        grid-template-columns: 1fr;
    }
    
    /* Modal responsive fixes */
    .modal {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal.show {
        padding: 0;
    }
    
    .modal-content {
        padding: 20px 16px;
        border-radius: 0;
        max-height: 100vh;
        max-width: 100%;
        width: 100%;
        margin: 0;
        overflow-x: hidden;
    }
    
    .close-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    
    .modal-symbol {
        font-size: 28px;
        word-break: break-word;
    }
    
    .modal-price {
        font-size: 36px;
        margin: 16px 0;
    }
    
    .modal-change {
        font-size: 18px;
        padding: 8px 14px;
        margin-bottom: 24px;
    }
    
    #chart {
        height: 280px !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .price-labels {
        flex-direction: column;
        gap: 12px;
    }
    
    .price-label-item {
        width: 100%;
    }
}
