/* Ruble Pool Stats UI v1.0.0
 * Additive production overlay for stable merged-mining telemetry.
 * Historical pool assets remain unchanged.
 */

#panel-miners [data-miner-mode-panel][hidden] {
  display: none !important;
}

.merge-metrics > .stats-hashrate-primary,
.miner-merge-stats > .stats-hashrate-primary {
  border-color: rgba(66, 214, 154, .32);
  background: linear-gradient(145deg, rgba(66, 214, 154, .09), rgba(9, 13, 17, .94));
  box-shadow: inset 3px 0 0 rgba(66, 214, 154, .72);
}

.miner-merge-stats > .stats-hashrate-primary {
  grid-column: span 2;
}

.stats-hashrate-volatile {
  border-style: dashed !important;
}

.stats-metric-note {
  display: block;
  margin-top: 6px;
  color: #788292;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.stats-metric-note.is-live {
  color: #75d7ad;
}

.stats-metric-note.is-warming {
  color: #ddb96d;
}

.stats-value-unavailable {
  color: #8b94a3 !important;
  font-size: .9em !important;
  white-space: normal !important;
}

.stats-v2-panel {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(17, 21, 29, .95), rgba(8, 10, 14, .96));
}

.stats-v2-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.stats-v2-head h4 {
  margin: 0;
  color: #eef1f6;
  font-size: 18px;
  letter-spacing: -.02em;
}

.stats-v2-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: #858e9e;
  font-size: 13px;
  line-height: 1.5;
}

.stats-v2-availability {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  color: #9ca5b4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-v2-availability.is-live {
  border-color: rgba(66, 214, 154, .32);
  background: rgba(66, 214, 154, .08);
  color: #75d7ad;
}

.stats-v2-availability.is-warming {
  border-color: rgba(238, 178, 62, .32);
  background: rgba(238, 178, 62, .08);
  color: #ddb96d;
}

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

.stats-v2-metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(0, 0, 0, .16);
}

.stats-v2-metric small {
  display: block;
  color: #7e8797;
  font-size: 12px;
  line-height: 1.3;
}

.stats-v2-metric strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: #edf0f5;
  font-size: 15px;
  line-height: 1.35;
}

.stats-v2-reasons {
  grid-column: span 2;
}

.personal-work-note {
  display: block;
  margin-top: 5px;
  color: #8d97a7;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.stats-card-table td[data-state="unavailable"] {
  color: #8b94a3;
}

@media (max-width: 1180px) {
  .stats-v2-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .stats-v2-panel {
    padding: 16px;
  }

  .stats-v2-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-v2-availability {
    align-self: flex-start;
    white-space: normal;
  }

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

  #panel-merged .data-table-wrap:has(.stats-card-table),
  #panel-blocks .data-table-wrap:has(.stats-card-table),
  #panel-miners .data-table-wrap:has(.stats-card-table),
  #panel-credits .data-table-wrap:has(.stats-card-table),
  #panel-payouts .data-table-wrap:has(.stats-card-table) {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .stats-card-table {
    display: block;
    min-width: 0 !important;
  }

  .stats-card-table caption {
    display: block;
    padding: 0 0 10px;
    text-align: left;
    white-space: normal;
  }

  .stats-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .stats-card-table tbody {
    display: grid;
    gap: 12px;
  }

  .stats-card-table tbody tr {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(11, 14, 20, .94);
  }

  .stats-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    width: auto;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
  }

  .stats-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .stats-card-table tbody td::before {
    content: attr(data-label);
    color: #7f8999;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .stats-card-table tbody td[colspan] {
    display: block;
  }

  .stats-card-table tbody td[colspan]::before {
    content: none;
  }

  .stats-card-table .hash-cell {
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
  }
}

@media (max-width: 390px) {
  .miner-merge-stats > .stats-hashrate-primary,
  .stats-v2-reasons {
    grid-column: auto;
  }

  .stats-v2-grid {
    grid-template-columns: 1fr;
  }

  .stats-card-table tbody td {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-v2-panel,
  .stats-card-table tbody tr {
    scroll-behavior: auto;
  }
}
