:root {
    --bg: #06151a;
    --bg-soft: #0a2027;
    --panel: rgba(11, 34, 42, 0.86);
    --panel-strong: #0c232b;
    --border: rgba(255, 214, 102, 0.16);
    --text: #f5f7f8;
    --muted: #9eb0b8;
    --gold: #e8be61;
    --gold-2: #c89b3c;
    --green: #35c781;
    --red: #ff7b7b;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    --radius: 22px;
    --surface-grad: linear-gradient(180deg, rgba(18, 43, 52, 0.92), rgba(10, 30, 37, 0.94));
    --surface-alt: rgba(255,255,255,0.02);
}

html[data-theme="light"] {
    --bg: #f5f7f8;
    --bg-soft: #eef3f5;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-strong: #ffffff;
    --border: rgba(15, 23, 42, 0.09);
    --text: #0f172a;
    --muted: #5f7280;
    --gold: #b8841f;
    --gold-2: #996a0f;
    --green: #178f57;
    --red: #d45151;
    --shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    --surface-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    --surface-alt: rgba(15, 23, 42, 0.025);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(232, 190, 97, 0.08), transparent 20%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 42%, var(--bg) 100%);
    color: var(--text);
    transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }
.container { width: min(1180px, calc(100% - 24px)); margin: 0 auto; }

.content-section { padding: 20px 0; }
.alt-bg { background: var(--surface-alt); border-top: 1px solid rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.04); }
html[data-theme="light"] .alt-bg { border-color: rgba(15,23,42,0.05); }
.section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 22px; line-height: 1.35; }
.section-head a { color: var(--gold); font-weight: 700; font-size: 13px; }
.cards-grid { display: grid; gap: 12px; }
.four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat-card,
.hero-card,
.news-card,
.tool-card,
.inner-box {
    background: var(--surface-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card,
.tool-card { padding: 16px; }
.stat-card h3,
.tool-card h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.4; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-change { margin-top: 7px; font-weight: 700; font-size: 14px; }
.up { color: var(--green); }
.down { color: var(--red); }
.neutral { color: var(--gold); }

.table-wrap {
    background: var(--surface-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.rates-table { width: 100%; border-collapse: collapse; }
.rates-table th, .rates-table td { padding: 12px 14px; text-align: right; font-size: 13px; }
.rates-table thead { background: rgba(232, 190, 97, 0.08); }
html[data-theme="light"] .rates-table thead { background: rgba(184, 132, 31, 0.08); }
.rates-table tbody tr + tr td { border-top: 1px solid rgba(255,255,255,0.06); }
html[data-theme="light"] .rates-table tbody tr + tr td { border-color: rgba(15,23,42,0.06); }

.inner-page { padding: 22px 0 48px; }
.inner-box { padding: 22px; }
.inner-box h1 { margin-top: 0; font-size: 27px; }
.inner-box p { margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.85; }

@media (max-width: 980px) {
    .four-cols, .three-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-head h2 { font-size: 20px; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 28px, 1000px); }
    .content-section { padding: 16px 0; }
    .four-cols, .three-cols { grid-template-columns: 1fr; }
    .section-head { align-items: flex-start; flex-direction: column; margin-bottom: 10px; }
    .section-head h2 { font-size: 18px; }
    .section-head a { font-size: 12px; }
    .stat-card, .tool-card, .inner-box { padding: 14px; }
    .stat-card h3, .tool-card h3 { font-size: 15px; }
    .stat-value { font-size: 23px; }
    .stat-change { font-size: 13px; }
    .rates-table th, .rates-table td { padding: 10px 9px; font-size: 12px; }
    .inner-box h1 { font-size: 22px; }
    .inner-box p { font-size: 13px; }
}
