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

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(
            135deg,
            #f4f7f8,
            #ffffff 45%,
            #f7f4f4
        );

    color: #374151;
}


/* ========================================
   MAIN
======================================== */

.page-wrapper {
    width: min(96%, 1180px);
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    padding: 10px 10px 35px;
}



/* ========================================
   HEADER
======================================== */

.market-header {
    width: 100%;
    height: clamp(55px, 7vw, 92px);

    background: #fff;

    border-bottom:
        clamp(3px, 0.4vw, 6px)
        solid #492d2d;

    display: flex;
    overflow: hidden;
}


.market-header-title {

    width: 58%;
    height: 100%;

    background: #492d2d;
    color: #fff;

    display: flex;
    align-items: center;

    padding-left:
        clamp(20px, 4vw, 55px);

    padding-right: 80px;

    font-family:
        Impact,
        "Arial Narrow",
        sans-serif;

    font-size:
        clamp(28px, 4.5vw, 58px);

    font-weight: 900;
    font-style: italic;

    white-space: nowrap;

    clip-path: polygon(
        0 0,
        88% 0,
        100% 100%,
        0 100%
    );
}



/* ========================================
   STOCK CONTENT
======================================== */

.sgx-main-content {
    padding: 25px 20px 40px;
}


.sgx-section-title {

    font-size: 18px;
    font-weight: 700;

    color: #334155;

    margin-bottom: 25px;
}



/* ========================================
   PRICE + CHART
======================================== */

.sgx-price-section {

    display: grid;

    grid-template-columns:
        minmax(200px, 290px)
        minmax(0, 1fr);

    gap: 40px;

    align-items: start;
}



/* LEFT */

.sgx-current-price {

    font-size: 30px;
    font-weight: 700;

    color: #10b981;

    margin-bottom: 8px;
}


.sgx-change {

    font-size: 12px;
    font-weight: 600;

    color: #10b981;

    margin-bottom: 25px;
}


.sgx-data-table {
    width: 100%;
}


.sgx-data-row {

    min-height: 38px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid #e5e7eb;

    font-size: 11px;
}


.sgx-label {
    color: #777;
}


.sgx-value {

    color: #4b5563;

    white-space: nowrap;
}



/* ========================================
   CHART
======================================== */

.sgx-chart-area {
    min-width: 0;
}


.sgx-chart-controls {

    display: flex;

    justify-content: flex-end;

    margin-bottom: 10px;
}


.sgx-chart-controls button {

    min-width: 55px;

    height: 30px;

    padding: 0 8px;

    background: #fff;

    border: 1px solid #bbb;

    font-size: 10px;

    cursor: pointer;
}


.sgx-chart-controls button + button {
    border-left: 0;
}


.sgx-chart-controls .day-active {

    border: 2px solid #16a34a;

    color: #166534;

    font-weight: 700;
}


#chart-container {

    position: relative;

    width: 100%;

    height: clamp(220px, 28vw, 310px);

    border-left: 1px solid #eee;
    border-bottom: 1px solid #ddd;
}


#myChart {

    width: 100% !important;
    height: 100% !important;
}



/* ========================================
   RESULT UNDER CHART
======================================== */

.sgx-bottom-table-wrapper {
    margin-top: 15px;
}


.custom-table {

    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;

    font-size: 11px;
}


.custom-table td {

    border: 1px solid #aaa;

    padding: 9px 6px;

    text-align: center;
}


.custom-table td:first-child {
    width: 40%;
}


#custom-top,
#custom-bottom {

    font-weight: 700;
    color: #374151;
}


.sgx-bottom-data-row {

    text-align: right;

    margin-top: 22px;

    font-size: 9px;

    color: #aaa;
}



/* ========================================
   STOCK TICKER
======================================== */

.nebula-stream {

    width: 100%;

    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;

    background: #f8fafc;

    overflow: hidden;
}


.cosmos-ticker {

    min-width: max-content;

    min-height: 42px;

    display: flex;

    align-items: center;

    gap: 32px;

    padding: 0 15px;

    white-space: nowrap;
}


.astral-asset {

    display: flex;

    align-items: center;

    gap: 6px;

    font-size: 11px;

    color: #64748b;
}


.asset-name {

    font-weight: 700;

    color: #64748b;
}


.asset-value {
    color: #64748b;
}


.pulse-up {
    color: #16a34a;
    font-weight: 700;
}


.pulse-down {
    color: #ef4444;
    font-weight: 700;
}


.badge-gain {

    padding: 3px 5px;

    border-radius: 3px;

    background: #dcfce7;

    color: #15803d;

    font-size: 10px;

    font-weight: 700;
}


.cosmic-gate {

    width: 1px;

    height: 20px;

    background: #cbd5e1;
}



/* ========================================
   HISTORY
======================================== */

.history-section {

    padding: 35px 10px 0;
}


.sgx-history-title {

    margin: 0 0 15px;

    font-size: 20px;

    color: #444;

    font-weight: 700;
}


.history-table-wrapper {

    width: 100%;

    overflow-x: auto;
}


.sgx-history-table {

    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;

    font-size: 12px;
}


.sgx-history-table th {

    padding: 10px;

    border: 1px solid #ccc;

    background: #eee;

    color: #444;

    font-weight: 700;

    text-align: center;
}


.sgx-history-table td {

    padding: 10px;

    border: 1px solid #ccc;

    text-align: center;

    color: #555;
}



/* ========================================
   TABLET
======================================== */

@media (max-width: 850px) {

    .page-wrapper {
        width: 100%;
    }


    .market-header-title {
        width: 70%;
    }


    .sgx-price-section {

        grid-template-columns:
            190px minmax(0, 1fr);

        gap: 20px;
    }


    #chart-container {
        height: 250px;
    }

}



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

@media (max-width: 650px) {

    .page-wrapper {

        width: 100%;

        padding-left: 7px;
        padding-right: 7px;
    }


    .market-header {

        height: 60px;
    }


    .market-header-title {

        width: 88%;

        padding-left: 15px;
        padding-right: 50px;

        font-size: clamp(24px, 8vw, 34px);

        clip-path: polygon(
            0 0,
            87% 0,
            100% 100%,
            0 100%
        );
    }


    .sgx-main-content {

        padding: 20px 10px 30px;
    }


    .sgx-section-title {

        font-size: 16px;

        margin-bottom: 20px;
    }


    .sgx-price-section {

        display: block;
    }


    .sgx-left-data {

        margin-bottom: 25px;
    }


    .sgx-current-price {
        font-size: 27px;
    }


    .sgx-data-row {

        font-size: 11px;

        min-height: 34px;
    }


    .sgx-chart-controls {

        justify-content: flex-end;

        overflow-x: auto;
    }


    .sgx-chart-controls button {

        min-width: 52px;

        height: 28px;
    }


    #chart-container {

        height: 230px;
    }


    .cosmos-ticker {

        gap: 25px;

        overflow: visible;
    }


    .history-section {

        padding:
            25px 3px 0;
    }


    .sgx-history-title {
        font-size: 17px;
    }


    .sgx-history-table {

        font-size: 11px;
    }


    .sgx-history-table th,
    .sgx-history-table td {

        padding: 8px 5px;
    }

}



/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 380px) {

    .market-header-title {

        width: 92%;

        font-size: 23px;
    }


    #chart-container {
        height: 200px;
    }


    .custom-table {

        font-size: 9px;
    }

}