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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #333333;
    background:
        linear-gradient(
            rgba(70, 10, 18, 0.70),
            rgba(70, 10, 18, 0.70)
        ),
        url("russia-bg.jpg") center / cover fixed no-repeat;
}

.top-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    color: #333333;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.flag {
    font-size: 17px;
}

.nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 36px;
}

.nav a {
    color: #6b7280;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}

.nav a:hover {
    color: #800020;
}

.page-shell {
    width: min(1180px, calc(100% - 30px));
    min-height: 1000px;
    margin: 10px auto 0;
    padding: 0 10px 60px;
    background: #ffffff;
}

.russia-banner {
    position: relative;
    width: 100%;
    height: 92px;
    background: #ffffff;
    overflow: hidden;
}

.banner-shape {
    position: absolute;
    top: 0;
    left: 0;
    width: 520px;
    max-width: 55%;
    height: 78px;
    padding: 7px 0 0 55px;
    background: #4b2020;
    color: #ffffff;
    font-size: 48px;
    line-height: 1;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -2px;
    clip-path: polygon(
        0 0,
        82% 0,
        100% 100%,
        0 100%
    );

    transform: none;
    text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.15);
}

.banner-shape::first-line {
    transform: skewX(-38deg);
}

.banner-shape {
    text-shadow: 2px 2px 1px rgba(0,0,0,.15);
}

.banner-line {
    position: absolute;
  
    left: 0;
    right: 0;
    bottom: 10px;
    height: 5px;
    background: #4b2020;
}

.ticker {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    padding: 0 10px;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
    color: #7b8189;
    font-size: 10px;
    white-space: nowrap;
}

.up,
.gain {
    color: #10b981;
}

.down {
    color: #ef4444;
}

.gain {
    margin-left: 4px;
    padding: 2px 4px;
    background: #e9f8ef;
    font-size: 9px;
}

.intro {
    padding: 35px 15px 25px;
    text-align: center;
}

.intro h1 {
    margin-bottom: 22px;
    color: #111111;
    font-size: 22px;
}

.intro p {
    margin: 0 0 17px;
    color: #555555;
    font-size: 11px;
    line-height: 1.7;
}

.market-section {
    margin-top: 10px;
}

.market-title {
    margin-bottom: 20px;
    color: #333333;
    font-size: 15px;
    font-weight: 700;
}

.market-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 35px;
}

.current-price {
    color: #ef4444;
    font-size: 29px;
    font-weight: 700;
}

.change-line {
    margin-top: 8px;
    margin-bottom: 22px;
    color: #ef4444;
    font-size: 11px;
}

.data-table {
    width: 100%;
}

.data-row {
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #e5e5e5;
    color: #777777;
    font-size: 10px;
}

.data-row strong {
    color: #555555;
    font-weight: 400;
}

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

.chart-controls {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.chart-controls button {
    height: 25px;
    min-width: 52px;
    padding: 0 7px;
    border: 1px solid #999999;
    border-right: 0;
    background: #ffffff;
    color: #555555;
    font-size: 8px;
    cursor: pointer;
}

.chart-controls button:last-child {
    border-right: 1px solid #999999;
}

.chart-controls button.active {
    border: 2px solid #189b35;
    color: #168c30;
}

#chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

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

.result-bar {
    width: 100%;
    margin-top: 8px;
    display: grid;
    grid-template-columns: 2fr 1fr .55fr 1fr .55fr;
    border: 1px solid #b8bec5;
}

.result-bar > div {
    min-height: 37px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #b8bec5;
    color: #374151;
    font-size: 9px;
}

.result-bar > div:last-child {
    border-right: 0;
}

.result-value {
    font-weight: 700;
}

.update-time {
    margin-top: 18px;
    text-align: right;
    color: #a0a0a0;
    font-size: 8px;
}

.history-section {
    margin-top: 80px;
}

.history-title {
    margin-bottom: 16px;
    color: #222222;
    font-size: 17px;
    font-weight: 700;
}

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

.history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
    border: 1px solid #cfcfcf;
}

.history-table th,
.history-table td {
    height: 42px;
    padding: 8px 10px;
    border-right: 1px solid #d5d5d5;
    border-bottom: 1px solid #d5d5d5;
    text-align: center;
}

.history-table th {
    background: #f1f1f1;
    color: #333333;
    font-size: 10px;
    font-weight: 700;
}

.history-table td {
    color: #333333;
    font-size: 11px;
}

.history-table th:last-child,
.history-table td:last-child {
    border-right: 0;
}

.history-table tbody tr:last-child td {
    border-bottom: 0;
}

.history-table tbody tr:hover td {
    background: #fafafa;
}

.loading-text,
.no-data-text {
    color: #777777 !important;
}

.error-text {
    color: #ef4444 !important;
}

.footer {
    width: 100%;
    padding: 45px 20px 60px;
    background: #001d4b;
    color: #ffffff;
}

.footer-grid {
    width: min(1160px, 100%);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 80px;
}

.footer h3 {
    margin-bottom: 22px;
    font-size: 11px;
}

.footer p,
.footer a {
    display: block;
    margin-bottom: 10px;
    color: #d6dfec;
    font-size: 10px;
    line-height: 1.7;
    text-decoration: none;
}

@media (max-width: 900px) {
    .nav {
        gap: 15px;
    }

    .nav a {
        font-size: 9px;
    }

    .market-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 20px;
    }

    .banner-shape {
        font-size: 42px;
    }
}

@media (max-width: 700px) {
    body {
        background: #ffffff;
    }

    .header-inner {
        min-height: 52px;
    }

    .nav {
        display: none;
    }

    .page-shell {
        width: 100%;
        margin-top: 0;
        padding: 0 12px 50px;
    }

    .russia-banner {
        height: 80px;
    }

    .banner-shape {
        width: 75%;
        max-width: none;
        height: 68px;
        padding: 8px 0 0 30px;
        font-size: 34px;
    }

    .ticker {
        gap: 20px;
        overflow-x: auto;
    }

    .intro {
        padding-top: 25px;
    }

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

    .market-info {
        width: 100%;
    }

    #chart-container {
        height: 250px;
    }

    .history-section {
        margin-top: 55px;
    }

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

@media (max-width: 480px) {
    .banner-shape {
        width: 82%;
        padding-left: 22px;
        font-size: 28px;
    }

    .intro h1 {
        font-size: 19px;
    }

    .intro p {
        font-size: 10px;
    }

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

    .chart-controls button {
        flex: 1;
        min-width: 0;
        padding: 0 2px;
        font-size: 7px;
    }

    #chart-container {
        height: 220px;
    }

    .result-bar {
        grid-template-columns: 1.5fr .9fr .55fr .9fr .55fr;
    }

    .result-bar > div {
        font-size: 8px;
    }

    .history-table th,
    .history-table td {
        height: 38px;
        padding: 6px 3px;
        font-size: 10px;
    }
}