.xray-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.xray-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xray-icon {
  font-size: 14px;
}

.xray-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.titlebar-right {
  display: flex;
  align-items: center;
}

.xray-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.spinner.small {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
}

.latency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.latency-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.latency-badge.online .latency-dot {
  background: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
}

.xray-body {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}

.xray-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
}

.placeholder-icon {
  font-size: 32px;
  opacity: 0.5;
}

.placeholder-icon.rotating {
  animation: spin 3s linear infinite;
}

.xray-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  gap: 12px;
}

.error-icon {
  font-size: 32px;
}

.error-text {
  color: var(--status-error);
  font-weight: 500;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.xray-json {
  padding: 20px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Moles Viewer Specifics */
.moles-viewer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.moles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.moles-badge {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.moles-uid {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.moles-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.text-accent {
  color: var(--accent-blue);
}

.text-danger {
  color: #ef4444;
}

.moles-section-title {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.moles-boards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.board-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.board-card.played {
  opacity: 0.7;
}

.board-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.board-round {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.board-status {
  display: flex;
}

.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-badge.played {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.status-badge.upcoming {
  background: rgba(168, 162, 158, 0.1);
  color: #a8a29e;
}

.board-positions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.pos-label {
  font-size: 12px;
  color: var(--text-dim);
}

.pos-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pos-tag {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* ===== Mines Viewer ===== */
.mines-viewer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mines-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mines-badge {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(251, 146, 60, 0.15));
  color: #f97316;
  border: 1px solid rgba(251, 146, 60, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.mines-uid {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 380px;
}

.mines-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: default;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mines-cell.is-safe {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.mines-cell.is-safe:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  transform: scale(1.05);
}

.mines-cell.is-bomb {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  animation: bombPulse 2s ease-in-out infinite;
}

.mines-cell.is-bomb:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
  transform: scale(1.05);
}

@keyframes bombPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
}

.cell-index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.6;
}

.cell-icon {
  font-size: 20px;
  line-height: 1;
}

.mines-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.safe {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.legend-dot.bomb {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.legend-raw {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 11px;
}
