@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #17201e;
  --muted: #6c7974;
  --paper: #f4f1ea;
  --panel: #fffdf8;
  --line: #d9ddd5;
  --teal: #0c7771;
  --teal-dark: #07544f;
  --coral: #d8644c;
  --lime: #c4d65e;
  --yellow: #f0bf5b;
  --shadow: 0 18px 45px rgba(24, 42, 36, .07);
}

* { box-sizing: border-box; }
html { background: #0a1624; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: 'Manrope', system-ui, sans-serif; position: relative; }
body::before { content: ''; position: fixed; inset: 0; z-index: 0; background: linear-gradient(rgba(244,241,234,.82), rgba(244,241,234,.9)), url('/assets/bg.png') center top / cover no-repeat; pointer-events: none; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
.shell { max-width: 1440px; margin: 0 auto; padding: 0 42px 28px; position: relative; z-index: 1; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: 'DM Mono', monospace; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; background: var(--ink); color: var(--lime); font-weight: 500; }
.brand-slash { color: var(--coral); margin: 0 2px; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 11px 'DM Mono', monospace; letter-spacing: .06em; }
.live-dot { width: 7px; height: 7px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 4px rgba(216, 100, 76, .13); }
.icon-button { width: 34px; height: 34px; margin-left: 10px; padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--panel); cursor: pointer; font-size: 19px; line-height: 1; }
.icon-button:hover { border-color: var(--teal); color: var(--teal); }
.icon-button:focus-visible { outline: 3px solid rgba(12, 119, 113, .25); outline-offset: 2px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 62px 0 36px; }
.eyebrow, .panel-kicker, .metric-label, .sync-label, dt { margin: 0; color: var(--muted); font: 11px 'DM Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 800px; margin: 14px 0 10px; font-size: clamp(38px, 5vw, 76px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
h2 { margin: 7px 0 0; font-size: 20px; line-height: 1.15; letter-spacing: -.025em; }
.identity { margin: 0; color: var(--muted); font: 13px 'DM Mono', monospace; }
.sync-block { min-width: 214px; padding-bottom: 5px; border-left: 2px solid var(--coral); padding-left: 16px; }
.sync-block strong { display: block; margin: 8px 0 2px; color: var(--teal-dark); font: 22px 'DM Mono', monospace; }
.sync-block span:last-child { color: var(--muted); font-size: 12px; }
.hero-grid { display: grid; grid-template-columns: 1.23fr .77fr; gap: 16px; }
.rp-panel, .signal-panel, .metric-card, .section-panel { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rp-panel { min-height: 270px; padding: 28px 32px; background: var(--teal-dark); color: #f6f7ef; border-color: var(--teal-dark); position: relative; overflow: hidden; }
.rp-panel::after { content: 'RP'; position: absolute; right: 26px; bottom: -25px; color: rgba(196, 214, 94, .12); font: 180px 'DM Mono', monospace; line-height: 1; }
.rp-panel .panel-kicker { color: rgba(246, 247, 239, .63); }
.rp-value { margin: 28px 0 19px; color: var(--lime); font: 88px 'DM Mono', monospace; letter-spacing: -.1em; line-height: .8; position: relative; z-index: 1; }
.rp-meta-row, .rp-rule, .signal-foot { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.rp-meta-row { color: rgba(246, 247, 239, .72); font: 12px 'DM Mono', monospace; }
.status-pill { padding: 5px 8px; background: var(--coral); color: #fff; font-size: 10px; letter-spacing: .08em; }
.rp-rule { gap: 8px; margin-top: 45px; color: rgba(246, 247, 239, .55); font: 10px 'DM Mono', monospace; }
.rp-rule strong { color: #fff; font-size: 15px; font-weight: 500; margin-right: 14px; }
.rp-method { position: relative; z-index: 1; margin: 10px 0 0; color: rgba(246, 247, 239, .52); font-size: 11px; }
.signal-panel { min-height: 270px; padding: 28px 30px; display: flex; flex-direction: column; justify-content: space-between; }
.signal-number { margin-top: 23px; display: flex; align-items: baseline; gap: 9px; color: var(--coral); font: 74px 'DM Mono', monospace; letter-spacing: -.08em; }
.signal-number small { color: var(--muted); font: 14px 'Manrope', sans-serif; letter-spacing: 0; }
.signal-panel p { max-width: 230px; margin: 2px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.signal-bar { height: 8px; background: #e7ebe4; overflow: hidden; }
.signal-bar span { display: block; width: 0; height: 100%; background: var(--coral); transition: width .8s ease; }
.signal-foot { justify-content: space-between; margin-top: 14px; color: var(--muted); font: 10px 'DM Mono', monospace; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.metric-card { min-height: 132px; padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card strong { font: 32px 'DM Mono', monospace; color: var(--teal-dark); letter-spacing: -.07em; }
.metric-card span:last-child { color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin-top: 16px; }
.section-panel { padding: 27px 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.heading-note { color: var(--muted); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .06em; text-align: right; }
.chart-wrap { height: 250px; margin-top: 22px; }
#rating-chart { width: 100%; height: 100%; overflow: visible; }
.profile-list { margin: 34px 0 0; }
.profile-list div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.profile-list dd { margin: 0; color: var(--teal-dark); font: 12px 'DM Mono', monospace; text-align: right; }
.notice { margin-top: 22px; padding: 11px 12px; color: #765f28; background: #fff3d8; border-left: 3px solid var(--yellow); font-size: 12px; line-height: 1.45; }
.hidden { display: none; }
.contests-panel { margin-top: 16px; }
.code-panel { margin-top: 16px; }
.code-form { display: flex; align-items: end; gap: 10px; margin-top: 23px; }
.code-form label { color: var(--muted); font: 11px 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.code-form input { width: min(280px, 100%); height: 40px; padding: 0 12px; border: 1px solid var(--line); color: var(--ink); background: #fff; font: 13px 'DM Mono', monospace; }
.code-form input:focus { outline: 3px solid rgba(12, 119, 113, .18); border-color: var(--teal); }
.code-form button { height: 40px; padding: 0 16px; border: 0; background: var(--teal-dark); color: #fff; cursor: pointer; font-size: 13px; }
.code-form button:hover { background: var(--teal); }
.code-form button:disabled { opacity: .55; cursor: wait; }
.code-status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.code-status.error { color: var(--coral); }
.code-result { margin-top: 7px; border: 1px solid var(--line); background: #1b2927; overflow: hidden; }
.code-meta { display: flex; flex-wrap: wrap; gap: 16px; padding: 11px 14px; color: #b4c9be; border-bottom: 1px solid rgba(255,255,255,.12); font: 10px 'DM Mono', monospace; }
.code-result pre { max-height: 480px; margin: 0; padding: 18px; overflow: auto; color: #ecf4df; font: 12px/1.65 'DM Mono', monospace; white-space: pre; }
.table-scroll { margin-top: 22px; overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th { padding: 0 12px 12px; color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .08em; text-align: left; font-weight: 400; }
td { padding: 15px 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; }
td:first-child { max-width: 310px; font-weight: 700; }
td:nth-child(n+2) { color: var(--muted); font: 11px 'DM Mono', monospace; }
.delta-up { color: var(--teal) !important; }
.delta-down { color: var(--coral) !important; }
.state { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font: 10px 'DM Mono', monospace; text-transform: uppercase; }
.state::before { content: ''; width: 6px; height: 6px; background: var(--teal); border-radius: 50%; }
.state-muted { color: var(--muted); }
.state-muted::before { background: var(--yellow); }
.empty { color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; padding-top: 24px; color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .08em; }
@media (max-width: 900px) {
  .shell { padding: 0 20px 22px; }
  .intro { padding-top: 42px; }
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar { height: 66px; }
  .topbar-meta { font-size: 9px; }
  .intro { display: block; padding: 40px 0 27px; }
  .sync-block { margin-top: 30px; }
  h1 { font-size: 48px; }
  .rp-panel, .signal-panel, .section-panel { padding: 23px 20px; }
  .rp-value { font-size: 70px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 116px; padding: 16px; }
  .metric-card strong { font-size: 26px; }
  .section-heading { display: block; }
  .heading-note { display: block; margin-top: 12px; text-align: left; }
  .code-form { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .code-form label { grid-column: 1 / -1; }
  .code-form input { width: 100%; }
  footer { display: block; line-height: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
