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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(240, 185, 11, 0.06),
            transparent 32%
        ),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

button {
    font-family: inherit;
}

.header {
    height: 68px;
    background: rgba(11, 14, 17, 0.96);
    border-bottom: 1px solid #252a30;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1400px, calc(100% - 40px));
    height: 100%;
    margin: auto;
    display: flex;
    align-items: center;
}

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

.logo-mark {
    width: 34px;
    height: 34px;
    position: relative;
    transform: rotate(45deg);
}

.logo-mark span,
.logo-mark i {
    position: absolute;
    width: 9px;
    height: 9px;
    background: var(--gold);
}

.logo-mark span:nth-child(1) {
    left: 0;
    top: 12px;
}

.logo-mark span:nth-child(2) {
    left: 12px;
    top: 0;
}

.logo-mark span:nth-child(3) {
    left: 12px;
    top: 24px;
}

.logo-mark i {
    left: 24px;
    top: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .4px;
}

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

.nav {
    margin-left: 60px;
    display: flex;
    gap: 32px;
}

.nav a {
    color: #c5cad1;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

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

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.live-dot {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #b7bdc6;
    font-size: 11px;
    font-weight: 700;
}

.live-dot span {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(14,203,129,.7);
}

.access-btn {
    border: 0;
    background: var(--gold);
    color: #181a20;
    height: 38px;
    padding: 0 20px;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
}

.access-btn:hover {
    background: var(--gold2);
}

.hero {
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(
            120deg,
            #11151b,
            #181a20
        );
}

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

.hero-tag,
.section-tag {
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    margin-bottom: 9px;
}

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

.hero h1 span {
    color: var(--gold);
}

.hero p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.market-state {
    min-width: 210px;
    padding: 16px 18px;
    background: #0b0e11;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 15px rgba(14,203,129,.6);
}

.market-state small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-bottom: 4px;
}

.market-state strong {
    font-size: 12px;
}

.page-container {
    width: min(1400px, calc(100% - 40px));
    margin: 30px auto 60px;
}

.market-card,
.about-card,
.history-card {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
}

.market-card {
    overflow: hidden;
}

.market-head {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.market-symbol {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
}

.market-head h2 {
    font-size: 21px;
}

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

.market-time {
    text-align: right;
}

.market-time span {
    display: block;
    color: var(--green);
    font-size: 9px;
    font-weight: 800;
    margin-bottom: 4px;
}

.market-time strong {
    font-size: 13px;
}

.market-content {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
}

.price-panel {
    padding: 24px;
    border-right: 1px solid var(--border);
}

.panel-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.current-price {
    font-size: 38px;
    font-weight: 700;
    color: var(--green);
    margin-top: 8px;
}

.price-change {
    color: var(--green);
    display: flex;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 5px;
}

.price-status {
    color: var(--muted);
    font-size: 10px;
    margin: 7px 0 24px;
}

.stats {
    border-top: 1px solid var(--border);
}

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

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

.stat-row strong {
    font-size: 11px;
    font-weight: 500;
}

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

.chart-toolbar {
    height: 35px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

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

.chart-live {
    color: var(--green);
    font-size: 8px;
    margin-left: 7px;
}

.chart-buttons {
    display: flex;
}

.chart-buttons button {
    background: transparent;
    color: var(--muted);
    border: 0;
    height: 25px;
    padding: 0 10px;
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
}

.chart-buttons button.active {
    background: var(--gold);
    color: #181a20;
    font-weight: 800;
}

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

#myChart {
    width: 100% !important;
    height: 100% !important;
}

.result-section {
    min-height: 82px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.3fr;
}

.result-status,
.result-item {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
}

.result-status {
    gap: 12px;
}

.result-icon {
    width: 32px;
    height: 32px;
    background: rgba(240,185,11,.12);
    color: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-status span,
.result-item span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-bottom: 5px;
}

.result-status strong {
    font-size: 12px;
}

.result-item {
    flex-direction: column;
}

.result-item strong {
    font-size: 20px;
}

.result-item:nth-child(2) strong,
.result-item:nth-child(3) strong {
    color: var(--gold2);
}

.result-date-box {
    border-right: 0;
}

.result-date-box strong {
    font-size: 12px;
    color: var(--text);
}

.about-card {
    padding: 25px;
    margin-top: 20px;
}

.about-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.about-card p {
    max-width: 950px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 12px;
}

.history-card {
    margin-top: 20px;
    overflow: hidden;
}

.history-header {
    min-height: 90px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.history-header h2 {
    font-size: 20px;
}

.history-badge {
    color: var(--gold);
    background: rgba(240,185,11,.1);
    border: 1px solid rgba(240,185,11,.25);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 10px;
}

.history-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

#sgxHistoryTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#sgxHistoryTable thead {
    background: #20242b;
}

#sgxHistoryTable th {
    height: 44px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

#sgxHistoryTable td {
    height: 47px;
    text-align: center;
    color: #d8dce2;
    font-size: 11px;
    border-bottom: 1px solid var(--border);
}

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

#sgxHistoryTable tbody tr:hover {
    background: #20242b;
}

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

#sgxHistoryTable td:nth-child(2) {
    color: var(--gold2);
    font-weight: 700;
}

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

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

.footer-logo {
    font-size: 20px;
    font-weight: 800;
}

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

.footer-inner p {
    color: var(--muted);
    font-size: 10px;
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--muted);
    font-size: 11px;
}

.footer-links a:hover {
    color: var(--gold);
}

.copyright {
    border-top: 1px solid #20252b;
    text-align: center;
    padding: 18px;
    color: #5e6673;
    font-size: 9px;
}

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

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

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

    .stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .stat-row:nth-child(odd) {
        padding-right: 15px;
    }

    .stat-row:nth-child(even) {
        padding-left: 15px;
    }

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

    .result-status,
    .result-item {
        min-height: 75px;
        border-bottom: 1px solid var(--border);
    }

    .hero-inner {
        min-height: 135px;
    }
}

@media (max-width: 600px) {
    .header-inner,
    .hero-inner,
    .page-container,
    .footer-inner {
        width: calc(100% - 20px);
    }

    .header-right .live-dot {
        display: none;
    }

    .access-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 10px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .market-state {
        display: none;
    }

    .page-container {
        margin-top: 15px;
    }

    .market-head {
        padding: 16px;
    }

    .market-head h2 {
        font-size: 17px;
    }

    .price-panel {
        padding: 18px;
    }

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

    .chart-side {
        padding: 15px 8px;
    }

    .chart-container {
        height: 280px;
    }

    .chart-toolbar {
        padding: 0 7px;
    }

    .chart-buttons button {
        padding: 0 7px;
        font-size: 9px;
    }

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

    .history-header {
        padding: 17px;
    }

    .history-badge {
        display: none;
    }

    #sgxHistoryTable th,
    #sgxHistoryTable td {
        font-size: 9px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 25px;
    }

    .footer-links {
        gap: 15px;
        flex-wrap: wrap;
    }
}