:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #edf3ff;
  background: #071225;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #071225;
  --panel: #0d1b33;
  --panel-raised: #10213d;
  --line: #273d61;
  --muted: #93a6c4;
  --blue: #69b5ff;
  --green: #45d69a;
  --amber: #ffcc6a;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 52% -22%, #173b70 0, #0b1931 38%, var(--bg) 78%); }
a { color: inherit; }
button { font: inherit; }
.frame { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 62px); border-bottom: 1px solid #263c5f; background: #08142bed; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 850; letter-spacing: -.04em; text-decoration: none; }
.brand small { margin-left: 10px; padding-left: 11px; border-left: 1px solid #35496a; color: #a6b8d4; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #4d9dff; border-radius: 11px; background: linear-gradient(145deg, #277cf3, #164cb2); box-shadow: 0 5px 22px #1766d54c; font-size: 22px; }
.network { display: flex; align-items: center; gap: 10px; color: #d7e3f7; font-size: 13px; font-weight: 650; }
.network-icon { color: var(--amber); font-size: 20px; }
.separator, .freshness-divider { width: 1px; height: 18px; background: #354a69; margin: 0 4px; }
.sync-dot, .live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; color: var(--amber); }
.sync-dot.live { color: var(--green); background: var(--green); }
.sync-dot.error { color: #ff806f; background: #ff806f; }
main { width: min(1420px, calc(100% - 44px)); margin: 0 auto; padding: 34px 0 36px; }
.overview { padding: 25px 28px 0; border: 1px solid #263f65; border-radius: 18px; background: linear-gradient(120deg, #10213bdf, #0b192edb); box-shadow: 0 22px 48px #020b1a35; }
.overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.subhead { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.freshness { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid #2b4265; border-radius: 10px; color: #9fb0ca; font-size: 12px; white-space: nowrap; }
.freshness strong { color: #edf4ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; border-top: 1px solid #293f60; }
.stat { min-height: 94px; padding: 18px 16px; border-left: 1px solid #243a5a; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat > span, .stat small { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 5px; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat small { margin-top: 3px; font-size: 11px; }
.filters { display: flex; gap: 9px; margin: 22px 0 20px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #345079 transparent; }
.filter { flex: 0 0 auto; padding: 10px 17px; border: 1px solid #2b4266; border-radius: 10px; background: #0d1b32cc; color: #b7c6dc; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.filter:hover { border-color: #549cf0; color: #fff; }
.filter.active { border-color: #328cff; background: #1764d9; color: white; box-shadow: 0 4px 18px #125bc44a; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr); gap: 20px; align-items: start; }
.feed-section, .current-panel, .recent-panel, .contracts-panel { border: 1px solid var(--line); border-radius: 16px; background: #0b1830e8; box-shadow: 0 12px 36px #020a1733; }
.feed-section { min-height: 620px; padding: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2, .contracts-panel h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.section-head p { margin: 6px 0 0; color: #879ab7; font-size: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #27664f; border-radius: 99px; background: #12372f; color: #9ff1cb; font-size: 11px; font-weight: 700; white-space: nowrap; }
.live-pill i { background: var(--green); color: var(--green); }
.feed { display: grid; gap: 12px; margin-top: 19px; }
.event { position: relative; padding: 17px 18px 15px; border: 1px solid #2b4266; border-radius: 13px; background: linear-gradient(125deg, #10213b, #0b192e); animation: rise .25s ease both; }
.event-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.event-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 750; }
.event-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 9px; background: #183969; color: #78bdff; font-size: 15px; font-weight: 800; }
.event[data-kind="lottery"] .event-icon { background: #4a3718; color: #ffd36e; }
.event[data-kind="battle"] .event-icon { background: #26395c; color: #9dc5ff; }
.event[data-kind="queue"] .event-icon { background: #26394a; color: #94d7ce; }
.event[data-kind="trade"] .event-icon { background: #1d3c32; color: #6ee1a8; }
.event[data-kind="rewards"] .event-icon { background: #49351b; color: #ffc871; }
.event-state { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #665125; border-radius: 99px; background: #3b301b; color: var(--amber); font-size: 11px; font-weight: 750; }
.event-state.win { border-color: #2f6e54; background: #123c31; color: #91f0c0; }
.event-state.lose { border-color: #68404a; background: #3a2630; color: #ffb0ad; }
.event-summary { margin: 13px 0 0 41px; color: #e2eaf7; font-size: 14px; line-height: 1.55; }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 12px 0 0 41px; padding-top: 11px; border-top: 1px solid #253b5c; color: #90a3c0; font-size: 11px; }
.event a { color: var(--blue); text-decoration: none; }
.event a:hover, .text-link:hover { text-decoration: underline; }
.event-amount { color: #f1f5fc; font-weight: 700; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty-state { display: grid; justify-items: center; align-content: center; min-height: 380px; padding: 28px; border: 1px dashed #2e4568; border-radius: 13px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border: 1px solid #315080; border-radius: 50%; color: var(--blue); font-size: 24px; animation: spin 2.6s linear infinite; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.side-panel { display: grid; gap: 16px; }
.current-panel, .recent-panel, .contracts-panel { padding: 20px; }
.round-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #3866a0; border-radius: 50%; color: #80b9ff; font-size: 23px; }
.round-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #223858; color: #9eb0ca; font-size: 13px; }
.round-line:first-of-type { margin-top: 10px; }
.round-line:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.round-line strong { color: #e9f0fc; font-size: 12px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.room-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 9px; }
.room { padding: 9px 10px; border: 1px solid #294163; border-radius: 9px; background: #0d203a; color: #aebed4; font-size: 11px; }
.room strong { float: right; color: #f2f5fc; font-variant-numeric: tabular-nums; }
.text-link { color: var(--blue); font-size: 12px; text-decoration: none; white-space: nowrap; }
.recent-list { display: grid; gap: 0; margin-top: 15px; }
.recent-row { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 10px; min-height: 47px; border-top: 1px solid #233958; font-size: 12px; }
.recent-kind { color: #aabbd2; }
.recent-result { min-width: 0; overflow: hidden; color: #e2ebf8; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { color: #8598b5; font-size: 10px; white-space: nowrap; }
.quiet { color: #8295b2; font-size: 12px; }
.contracts-panel h2 { margin-bottom: 13px; }
.contracts-panel > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid #233958; color: #9eafc8; font-size: 12px; text-decoration: none; }
.contracts-panel code, .oracle-link { color: #73baff; font-size: 11px; }
.contracts-panel b { color: #6caeff; font-size: 14px; }
.sync-warning { margin-top: 15px; padding: 11px 13px; border: 1px solid #765a2a; border-radius: 9px; background: #302817; color: #f3d18b; font-size: 12px; line-height: 1.5; }
.sync-warning[hidden] { display: none; }
.footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 0 3px; color: #8194b2; font-size: 11px; }
.footer a { color: #9fb8d8; text-decoration: none; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { main { width: min(100% - 28px, 720px); padding-top: 22px; } .content-grid { grid-template-columns: 1fr; } .feed-section { min-height: 0; } .side-panel { grid-template-columns: 1fr 1fr; align-items: start; } .contracts-panel { grid-column: 1 / -1; } }
@media (max-width: 600px) {
  .topbar { height: 62px; padding: 0 16px; }
  .brand { gap: 8px; font-size: 18px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 19px; }
  .brand small { margin-left: 7px; padding-left: 8px; font-size: 12px; }
  .network { gap: 7px; font-size: 11px; }
  .network-icon { font-size: 16px; }
  .separator { height: 14px; margin: 0 1px; }
  main { width: calc(100% - 24px); padding: 16px 0 24px; }
  .overview { padding: 18px 16px 0; border-radius: 14px; }
  .overview-heading { display: block; }
  h1 { font-size: 24px; }
  .subhead { font-size: 12px; }
  .freshness { justify-content: flex-start; width: fit-content; margin-top: 13px; padding: 8px 10px; font-size: 10px; }
  .freshness strong { font-size: 11px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
  .stat { min-height: 74px; padding: 11px 12px; border-left: 1px solid #243a5a; border-bottom: 1px solid #243a5a; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-last-child(-n + 2) { border-bottom: 0; }
  .stat strong { font-size: 20px; }
  .filters { gap: 7px; margin: 14px 0 12px; padding-bottom: 2px; }
  .filter { padding: 8px 12px; border-radius: 9px; font-size: 12px; }
  .content-grid { gap: 12px; }
  .feed-section, .current-panel, .recent-panel, .contracts-panel { padding: 15px; border-radius: 13px; }
  .section-head h2, .contracts-panel h2 { font-size: 15px; }
  .section-head p { font-size: 11px; }
  .live-pill { padding: 6px 8px; font-size: 10px; }
  .feed { gap: 9px; margin-top: 14px; }
  .event { padding: 13px 12px 12px; border-radius: 11px; }
  .event-title { gap: 8px; font-size: 13px; }
  .event-icon { width: 29px; height: 29px; border-radius: 8px; }
  .event-state { padding: 4px 7px; font-size: 10px; }
  .event-summary { margin: 10px 0 0 37px; font-size: 12px; }
  .event-meta { gap: 8px 13px; margin: 10px 0 0 37px; padding-top: 9px; font-size: 10px; }
  .side-panel { grid-template-columns: 1fr; gap: 12px; }
  .contracts-panel { grid-column: auto; }
  .round-line { padding: 10px 0; font-size: 12px; }
  .round-line strong { font-size: 11px; }
  .recent-row { grid-template-columns: 63px 1fr auto; min-height: 43px; gap: 7px; font-size: 11px; }
  .recent-time { font-size: 9px; }
  .footer { display: grid; gap: 6px; margin-top: 14px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
