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

:root {
    --bg: #0b0e11;
    --bg2: #181a20;
    --card: #181a20;
    --card2: #1e2329;
    --yellow: #f0b90b;
    --yellow2: #fcd535;
    --text: #eaecef;
    --muted: #848e9c;
    --border: #2b3139;
    --green: #0ecb81;
    --red: #f6465d;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

button {
    font-family: inherit;
}

.page-width {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 14, 17, .96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    width: min(1400px, calc(100% - 40px));
    height: 72px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--yellow);
    color: #111;
    font-size: 24px;
    font-weight: 900;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.brand-name span {
    color: var(--yellow);
}

.brand-sub {
    margin-top: 1px;
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1.7px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 42px;
}

.desktop-nav a {
    color: #b7bdc6;
    font-size: 13px;
    transition: .2s;
}

.desktop-nav a:hover {
    color: var(--yellow);
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: white;
    font-size: 25px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
}

.hero {
    padding: 85px 0 75px;
    background:
        radial-gradient(circle at 80% 20%, rgba(240,185,11,.12), transparent 32%),
        linear-gradient(180deg, #11151c, #0b0e11);
    border-bottom: 1px solid var(--border);
}

.hero-badge {
    display: inline-flex;
    padding: 7px 13px;
    margin-bottom: 22px;
    border: 1px solid rgba(240,185,11,.35);
    border-radius: 6px;
    background: rgba(240,185,11,.08);
    color: var(--yellow);
    font-size: 12px;
    font-weight: 700;
}

.hero h1 {
    max-width: 720px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -2px;
}

.hero h1 span {
    display: block;
    color: var(--yellow);
}

.hero p {
    max-width: 600px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 16px;
}

.market-section,
.history-section {
    padding: 65px 0;
}

.section-heading {
    margin-bottom: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-label {
    margin-bottom: 5px;
    color: var(--yellow);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: 27px;
    letter-spacing: -.7px;
}

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

.market-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.market-card {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.market-info {
    padding: 28px;
    border-right: 1px solid var(--border);
}

.market-symbol {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.current-price {
    color: var(--green);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

.market-change {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    color: var(--green);
    font-size: 12px;
}

.market-data {
    margin-top: 28px;
}

.data-row {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.data-row span {
    color: var(--muted);
    font-size: 12px;
}

.data-row strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
}

.chart-side {
    min-width: 0;
    padding: 25px;
}

.chart-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
}

.chart-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.chart-controls {
    display: flex;
    gap: 5px;
}

.chart-controls button {
    min-width: 38px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
}

.chart-controls button.active {
    border-color: var(--yellow);
    background: var(--yellow);
    color: #181a20;
    font-weight: 700;
}

.chart-container {
    width: 100%;
    height: 320px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.result-bar {
    min-height: 58px;
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 150px 150px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.result-status,
.result-item {
    padding: 0 18px;
    display: flex;
    align-items: center;
}

.result-status {
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--yellow);
}

.result-item {
    justify-content: space-between;
    gap: 15px;
    border-left: 1px solid var(--border);
}

.result-item span {
    color: var(--muted);
    font-size: 10px;
}

.result-item strong {
    color: var(--yellow);
    font-size: 18px;
}

.update-time {
    margin-top: 10px;
    color: #5e6673;
    font-size: 10px;
    text-align: right;
}

.feature-section {
    padding-bottom: 25px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature-card {
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.feature-number {
    margin-bottom: 22px;
    color: var(--yellow);
    font-size: 12px;
    font-weight: 700;
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.feature-card p {
    color: var(--muted);
    font-size: 12px;
}

.history-limit {
    color: var(--muted);
    font-size: 11px;
}

.history-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.table-scroll {
    overflow-x: auto;
}

#sgxHistoryTable {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    text-align: center;
}

#sgxHistoryTable th {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
}

#sgxHistoryTable td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: #d8dce3;
    font-size: 12px;
}

#sgxHistoryTable tbody tr {
    transition: .2s;
}

#sgxHistoryTable tbody tr:hover {
    background: rgba(240,185,11,.045);
}

#sgxHistoryTable tbody tr:hover td {
    color: var(--yellow2);
}

#sgxHistoryTable tbody tr:last-child td {
    border-bottom: 0;
}

footer {
    margin-top: 50px;
    border-top: 1px solid var(--border);
    background: #0f1319;
}

.footer-grid {
    padding: 55px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 50px;
}

.footer-brand p {
    max-width: 280px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
}

footer h4 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 11px;
}

footer a {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
}

footer a:hover {
    color: var(--yellow);
}

.footer-bottom {
    padding: 18px;
    border-top: 1px solid var(--border);
    color: #5e6673;
    font-size: 10px;
    text-align: center;
}

@media (max-width: 900px) {
    .desktop-nav {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .mobile-nav.show {
        display: flex;
        padding: 10px 20px 20px;
        flex-direction: column;
        gap: 5px;
    }

    .mobile-nav a {
        padding: 12px;
        border-bottom: 1px solid var(--border);
        color: #b7bdc6;
        font-size: 12px;
    }

    .market-card {
        grid-template-columns: 1fr;
    }

    .market-info {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .feature-section {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .page-width,
    .topbar-inner {
        width: calc(100% - 24px);
    }

    .topbar-inner {
        height: 62px;
    }

    .brand-icon {
        width: 35px;
        height: 35px;
    }

    .brand-name {
        font-size: 17px;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 38px;
        letter-spacing: -1px;
    }

    .market-section,
    .history-section {
        padding: 45px 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .market-info,
    .chart-side {
        padding: 18px;
    }

    .chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-controls {
        width: 100%;
    }

    .chart-controls button {
        flex: 1;
    }

    .chart-container {
        height: 260px;
    }

    .result-bar {
        grid-template-columns: 1fr 1fr;
    }

    .result-status {
        grid-column: 1 / -1;
        min-height: 40px;
        border-bottom: 1px solid var(--border);
    }

    .result-item {
        min-height: 55px;
    }

    .result-item:nth-child(2) {
        border-left: 0;
    }

    .current-price {
        font-size: 31px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}