* {
  box-sizing: border-box;
}

:root {
  --panel-width: 60vw;
  --panel-opacity: 0.94;
  --text: #f7f9ff;
  --muted: #8490a8;
  --line: rgba(255,255,255,.07);
  --panel: rgba(8,16,31,.94);
  --card: rgba(13,23,43,.82);
  --accent: #02d6b3;
  --blue: #3978ff;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 35%, rgba(30,76,170,.16), transparent 34%),
    radial-gradient(circle at 92% 90%, rgba(0,172,155,.12), transparent 32%),
    linear-gradient(135deg, #020712 0%, #061021 44%, #03121c 100%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.013) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  opacity: .28;
}

.wallpaper {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.glow-a {
  width: 460px;
  height: 460px;
  left: 14%;
  bottom: 8%;
  background: rgba(40,79,255,.12);
}

.glow-b {
  width: 400px;
  height: 400px;
  right: 2%;
  bottom: 2%;
  background: rgba(0,206,171,.08);
}

.panel {
  position: absolute;
  top: 7vh;
  right: 2.5vw;
  width: var(--panel-width);
  max-width: 1180px;
  min-width: 700px;
  height: 86vh;
  min-height: 640px;
  padding: 28px;
  border: 1px solid rgba(114,139,185,.16);
  border-radius: 30px;
  background: rgba(7, 14, 27, var(--panel-opacity));
  box-shadow: 0 30px 100px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel.left {
  left: 2.5vw;
  right: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.clock {
  font-size: clamp(42px, 4vw, 72px);
  font-weight: 500;
  letter-spacing: -3px;
  line-height: .96;
}

.date {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(15px, 1.25vw, 22px);
}

.live-status {
  text-align: right;
  padding-top: 4px;
}

.brand {
  font-size: clamp(18px, 1.7vw, 28px);
  font-weight: 800;
  letter-spacing: .5px;
}

.sync {
  margin-top: 12px;
  color: #d6a94c;
  font-size: 12px;
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: #02d6b3;
  box-shadow: 0 0 16px rgba(2,214,179,.8);
}

.dot.error {
  background: #ff5f6d;
  box-shadow: 0 0 16px rgba(255,95,109,.6);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 16px 17px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(15,26,48,.82), rgba(8,17,32,.74));
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--muted);
}

.stat-value {
  margin-top: 11px;
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
  white-space: nowrap;
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: .95fr 1.15fr;
  gap: 14px;
}

.block {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11,21,40,.75), rgba(6,14,27,.65));
  padding: 16px;
  overflow: hidden;
}

.block-head {
  height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a4afc4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.badge {
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(99,121,157,.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  color: #8895ab;
}

.live-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: auto;
  height: calc(100% - 36px);
  padding-top: 10px;
  scrollbar-width: none;
}

.live-list::-webkit-scrollbar,
.recent-list::-webkit-scrollbar {
  display: none;
}

.live-item {
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 14px;
  background: rgba(8,17,32,.78);
  padding: 13px 14px;
}

.live-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.live-model {
  min-width: 0;
  font-size: clamp(16px, 1.25vw, 23px);
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-amount {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: clamp(16px, 1.15vw, 22px);
  font-weight: 800;
}

.live-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #7f8ca5;
  font-size: 12px;
}

.row {
  display: grid;
  grid-template-columns: 58px 1.1fr 1fr 86px;
  gap: 10px;
  align-items: center;
}

.recent-head {
  height: 32px;
  padding: 0 2px;
  color: #7d89a0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  border-bottom: 1px solid var(--line);
}

.recent-list {
  overflow: auto;
  height: calc(100% - 60px);
  scrollbar-width: none;
}

.recent-item {
  min-height: 39px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: #dfe5ef;
  font-size: 12px;
}

.recent-item .muted {
  color: #758299;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right {
  text-align: right;
}

.footer {
  display: flex;
  justify-content: space-between;
  color: #77849c;
  font-size: 11px;
}

.empty {
  color: #68768e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hidden {
  display: none !important;
}

.error-card {
  min-width: 420px;
  max-width: 580px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: rgba(8,16,31,.95);
  text-align: center;
}

.error-title {
  font-size: 28px;
  font-weight: 800;
}

.error-message {
  margin-top: 12px;
  color: #ff8791;
}

.error-help {
  margin-top: 15px;
  color: #8390a7;
  font-size: 13px;
}

code {
  color: #d8e3ff;
}

@media (max-width: 1200px) {
  .panel {
    width: 72vw;
    min-width: 620px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .block {
    min-height: 260px;
  }
}

@media (max-width: 800px) {
  .panel {
    inset: 2vh 2vw;
    width: auto;
    height: 96vh;
    min-width: 0;
    padding: 18px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 50px 1.2fr .9fr 70px;
  }
}
