:root {
  --bg: #081018;
  --bg-deep: #04070d;
  --surface: rgba(12, 20, 31, 0.52);
  --surface-strong: rgba(15, 24, 37, 0.96);
  --line: rgba(85, 112, 145, 0.32);
  --line-strong: rgba(114, 142, 176, 0.45);
  --text: #ebf2f8;
  --muted: #8a97a6;
  --orange: #f4a340;
  --orange-glow: rgba(244, 163, 64, 0.38);
  --gold-1: #ffcf57;
  --gold-2: #ffb11f;
  --gold-3: #ffe48b;
  --gold-glow: rgba(255, 198, 64, 0.34);
  --gold-haze: rgba(255, 193, 62, 0.08);
  --cyan: #61d4ff;
  --cyan-glow: rgba(97, 212, 255, 0.35);
  --lime: #7cf8a2;
  --gold: #ffd35e;
  --danger: #ff7f7f;
  --cube-size: 220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(97, 212, 255, 0.04), transparent 36%),
    radial-gradient(circle at 82% 28%, rgba(244, 163, 64, 0.05), transparent 28%),
    linear-gradient(rgba(40, 74, 73, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 74, 73, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, #0b1116, #070b12 56%, #06090f);
  background-size: auto, auto, 96px 96px, 96px 96px, auto;
}

code {
  font-family: "JetBrains Mono", monospace;
}

.page-shell {
  width: 100%;
  margin: 0 auto;
  padding: 48px 56px 40px;
}

.meta-pill,
.live-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 15, 24, 0.86);
  color: var(--lime);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  box-shadow: 0 0 24px rgba(97, 212, 255, 0.06);
}

.meta-pill {
  color: #90a9bb;
}

.panel {
  min-height: calc(100vh - 88px);
  padding: 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 0 0 2px;
}

.panel-title-group {
  display: flex;
  align-items: baseline;
  gap: 28px;
  flex-wrap: wrap;
}

.panel-chips {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-toggle {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(8, 15, 24, 0.86);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  cursor: pointer;
}

.lang-toggle:hover {
  border-color: rgba(255, 174, 43, 0.7);
  color: var(--gold);
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(44px, 5vw, 74px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.panel-sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 1.4vw, 24px);
  letter-spacing: -0.02em;
}

.legend-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 42px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  letter-spacing: 0.03em;
}

.legend-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.legend-found {
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange-glow);
}

.legend-pending {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.blocks-stage {
  position: relative;
}

.blocks-viewport {
  margin-top: 30px;
  overflow-x: auto;
  perspective: 1600px;
  scrollbar-width: thin;
  scrollbar-color: rgba(97, 212, 255, 0.55) transparent;
  min-height: 680px;
  position: relative;
  scroll-behavior: smooth;
}

.blocks-scene {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  width: max-content;
  min-width: 100%;
  padding: 18px 0 24px;
}

.scroll-nav {
  position: absolute;
  top: 42%;
  z-index: 20;
  width: 46px;
  height: 74px;
  border: 1px solid rgba(255, 174, 43, 0.48);
  background: rgba(5, 9, 14, 0.72);
  color: var(--gold);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 174, 43, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.scroll-nav-left {
  left: 0;
}

.scroll-nav-right {
  right: 0;
}

.scroll-nav:hover:not(:disabled) {
  border-color: rgba(255, 174, 43, 0.9);
  color: #ffe48b;
  background: rgba(12, 14, 13, 0.9);
}

.scroll-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.blocks-viewport::-webkit-scrollbar {
  height: 8px;
}

.blocks-viewport::-webkit-scrollbar-thumb {
  background: rgba(97, 212, 255, 0.45);
  border-radius: 999px;
}

.scene-placeholder {
  min-height: 500px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.block-cube-wrap {
  width: var(--cube-size);
  flex: 0 0 auto;
  position: relative;
}

.block-cube-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: 74%;
  height: 74%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 189, 48, 0.18), rgba(255, 189, 48, 0.05) 44%, transparent 72%);
  filter: blur(12px);
  opacity: 0.5;
  pointer-events: none;
}

.block-cube-wrap.pending-wrap::before {
  background: radial-gradient(circle, rgba(27, 209, 255, 0.18), rgba(27, 209, 255, 0.05) 44%, transparent 72%);
}

.block-label {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.block-label.found {
  color: var(--orange);
}

.block-label.pending {
  color: var(--cyan);
}

.block-cube-inner {
  width: var(--cube-size);
  height: var(--cube-size);
  perspective: 1200px;
}

.block-cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 28s linear infinite;
  --base-rotate-x: -12deg;
  --base-rotate-y: 0deg;
  transform: rotateY(var(--base-rotate-y)) rotateX(var(--base-rotate-x));
  will-change: transform;
}

.block-cube-wrap:hover .block-cube {
  animation-duration: 28s;
}

.block-cube.pending {
  animation: cube-spin 18s linear infinite;
}

.block-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border: 1.5px solid rgba(255, 174, 43, 0.95);
  background:
    linear-gradient(135deg, rgba(255, 176, 41, 0.14), rgba(0, 255, 136, 0.05)),
    rgba(12, 18, 13, 0.2);
  color: var(--text);
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  box-shadow:
    0 0 28px rgba(255, 174, 43, 0.2),
    inset 0 0 28px rgba(255, 174, 43, 0.07);
  overflow: hidden;
  backface-visibility: visible;
}

.block-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 210, 110, 0.08), transparent 56%),
    linear-gradient(180deg, rgba(255, 225, 157, 0.05), transparent 26%, transparent 74%, rgba(255, 188, 49, 0.05)),
    linear-gradient(135deg, rgba(255, 241, 196, 0.06), transparent 36%, transparent 64%, rgba(255, 180, 31, 0.04));
  pointer-events: none;
}

.block-cube.pending .block-face {
  border-color: rgba(27, 209, 255, 0.96);
  background:
    linear-gradient(135deg, rgba(27, 209, 255, 0.14), rgba(88, 166, 255, 0.05)),
    rgba(10, 24, 34, 0.2);
  box-shadow:
    0 0 30px rgba(27, 209, 255, 0.22),
    inset 0 0 32px rgba(27, 209, 255, 0.06);
}

.block-cube.pending .block-face::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(112, 229, 255, 0.08), transparent 56%),
    linear-gradient(180deg, rgba(177, 240, 255, 0.05), transparent 26%, transparent 74%, rgba(27, 209, 255, 0.05));
}

.block-face.front  { transform: translateZ(calc(var(--cube-size) / 2)); }
.block-face.back   { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.block-face.right  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.block-face.left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.block-face.top    { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.block-face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }

.bf-kicker {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.bf-height {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
  color: var(--gold-2);
  text-shadow:
    0 0 10px rgba(255, 186, 37, 0.4),
    0 0 24px rgba(255, 186, 37, 0.24);
}

.block-cube.pending .bf-height {
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-glow);
}

.bf-meta,
.bf-txs,
.bf-fee,
.bf-hash,
.bf-mini {
  margin-top: 7px;
  font-size: 15px;
  line-height: 1.45;
}

.bf-txs {
  color: var(--lime);
  text-shadow: 0 0 12px rgba(124, 248, 162, 0.16);
}

.bf-fee {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 211, 94, 0.14);
}

.bf-hash {
  color: #d6deeb;
  word-break: break-all;
}

.bf-pool {
  margin-top: 10px;
  max-width: 188px;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-eta {
  margin-top: 8px;
  color: var(--cyan);
  font-size: 16px;
}

.pending-dots::after {
  content: "";
  animation: dots 1.25s steps(4, end) infinite;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 26px 0 0;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cyan);
}

.chain-link {
  position: relative;
  width: 64px;
  height: 5px;
  flex: 0 0 auto;
  margin-top: calc(var(--cube-size) / 2 + 26px);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(244, 163, 64, 0.86), rgba(97, 212, 255, 0.95));
  box-shadow:
    0 0 12px rgba(255, 181, 39, 0.16),
    0 0 22px rgba(97, 212, 255, 0.12);
}

.chain-link::before,
.chain-link::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.chain-link::before {
  left: -4px;
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange-glow);
}

.chain-link::after {
  right: -4px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

@keyframes cube-spin {
  from {
    transform: rotateY(var(--base-rotate-y)) rotateX(var(--base-rotate-x));
  }
  to {
    transform: rotateY(calc(var(--base-rotate-y) + 360deg)) rotateX(var(--base-rotate-x));
  }
}

@keyframes dots {
  0%,
  25% {
    content: "";
  }
  26%,
  50% {
    content: ".";
  }
  51%,
  75% {
    content: "..";
  }
  76%,
  100% {
    content: "...";
  }
}

@media (max-width: 1100px) {
  .page-shell {
    padding: 28px 22px 30px;
  }

  .panel-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  :root {
    --cube-size: 188px;
  }

  .panel {
    min-height: auto;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-chips {
    flex-wrap: wrap;
  }

  .block-label {
    font-size: 11px;
  }

  .bf-height {
    font-size: 30px;
  }

  .bf-meta,
  .bf-txs,
  .bf-fee,
  .bf-hash,
  .bf-mini {
    font-size: 11px;
  }

  .legend-item {
    font-size: 14px;
  }

  .blocks-scene {
    min-height: 460px;
    gap: 24px;
  }
}
